The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Slow apache despite optimized

Discussion in 'Workarounds and Optimization' started by Sannin, Mar 16, 2012.

  1. Sannin

    Sannin Active Member

    Joined:
    May 19, 2011
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Hello!

    Despite my efforts for a fast and optimized apache for my vps, i notice that the maximum requests per second apache can achieve is actually quite low. Testing with a simple .html file:

    Code:
    # ab -n 1000 -c20 -v -k http://********/index.html
    This is ApacheBench, Version 2.3 <$Revision: 655654 $>                                                                                 
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/                                                               
    Licensed to The Apache Software Foundation, http://www.apache.org/                                                                     
                                                                                                                                           
    Benchmarking ******** (be patient)                                                                                                    
    Completed 100 requests                                                                                                                 
    Completed 200 requests                                                                                                                 
    Completed 300 requests                                                                                                                 
    Completed 400 requests
    Completed 500 requests
    Completed 600 requests
    Completed 700 requests
    Completed 800 requests
    Completed 900 requests
    Completed 1000 requests
    Finished 1000 requests
    
    
    Server Software:        Apache
    Server Hostname:        ********
    Server Port:            80
    
    Document Path:          /index.html
    Document Length:        1324 bytes
    
    Concurrency Level:      20
    Time taken for tests:   9.434 seconds
    Complete requests:      1000
    Failed requests:        0
    Write errors:           0
    Total transferred:      1531440 bytes
    HTML transferred:       1325234 bytes
    Requests per second:    106.00 [#/sec] (mean)
    Time per request:       188.686 [ms] (mean)
    Time per request:       9.434 [ms] (mean, across all concurrent requests)
    Transfer rate:          158.52 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:       79   88  55.1     85    1093
    Processing:    85   99  41.0     93     565
    Waiting:       84   95  25.2     92     406
    Total:        165  187  68.9    178    1194
    
    Percentage of the requests served within a certain time (ms)
      50%    178
      66%    181
      75%    183
      80%    184
      90%    190
      95%    200
      98%    237
      99%    553
     100%   1194 (longest request)

    Testing with 200 concurrent users:


    Code:
    ab -n 10000 -c200 -v -k http://*********/index.html
    This is ApacheBench, Version 2.3 <$Revision: 655654 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    
    Benchmarking ********* (be patient)
    Completed 1000 requests
    Completed 2000 requests
    Completed 3000 requests
    Completed 4000 requests
    Completed 5000 requests
    Completed 6000 requests
    Completed 7000 requests
    Completed 8000 requests
    Completed 9000 requests
    Completed 10000 requests
    Finished 10000 requests
    
    
    Server Software:        Apache
    Server Hostname:        ********
    Server Port:            80
    
    Document Path:          /index.html
    Document Length:        1324 bytes
    
    Concurrency Level:      200
    Time taken for tests:   66.847 seconds
    Complete requests:      10000
    Failed requests:        6
       (Connect: 0, Receive: 0, Length: 6, Exceptions: 0)
    Write errors:           0
    Total transferred:      15299820 bytes
    HTML transferred:       13239820 bytes
    Requests per second:    149.60 [#/sec] (mean)
    Time per request:       1336.939 [ms] (mean)
    Time per request:       6.685 [ms] (mean, across all concurrent requests)
    Transfer rate:          223.51 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:       79  341 848.8     91   31170
    Processing:    85  894 2600.6     99   57277
    Waiting:        0  831 2343.6     98   49852
    Total:        167 1235 2752.3    193   57499
    
    Percentage of the requests served within a certain time (ms)
      50%    193
      66%    204
      75%   1185
      80%   1197
      90%   3748
      95%   5430
      98%  10287
      99%  12839
     100%  57499 (longest request)

    Apache is working on a live server with little traffic at the time of the test. Also, i use csf firewall and mod_security with the latest free gotroot rules. I have seen some similar benchmarks and the requests per second for apache rise up to some thousands.

    This is the mpm worker configuration at pre_virtualhost_global.conf:

    <IfModule worker.c>
    ServerLimit 20
    StartServers 2
    MaxClients 500
    MinSpareThreads 50
    MaxSpareThreads 250
    ThreadLimit 25
    ThreadsPerChild 25
    MaxRequestsPerChild 1000
    </IfModule>
     
Loading...

Share This Page