Apache benchmarking tool giving different results

Avatar
  • Answered
Hi,
I am running Apache benchmarking tool to see the response time to fetch the pages of the site we hosted on 67.xx.xx.xx VPS server.

Below are two tests I ran:

Test1:
/usr/local/apache/bin/ab -n 1000 -c 300 http://localhost/in/product.php?subcat=33

Output:
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 localhost (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: localhost
Server Port: 80

Document Path: /in/product.php?subcat=33
Document Length: 236 bytes

Concurrency Level: 300
Time taken for tests: 20.430 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Non-2xx responses: 1001
Total transferred: 400400 bytes
HTML transferred: 236236 bytes
Requests per second: 48.95 [#/sec] (mean)
Time per request: 6129.134 [ms] (mean)
Time per request: 20.430 [ms] (mean, across all concurrent requests)
Transfer rate: 19.14 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 5 31.7 2 1000
Processing: 6 630 3119.5 14 20413
Waiting: 5 629 3119.6 14 20413
Total: 7 634 3120.4 16 20421

Percentage of the requests served within a certain time (ms)
50% 16
66% 16
75% 21
80% 24
90% 1224
95% 1225
98% 20231
99% 20420
100% 20421 (longest request)

Test 1 Interpretation:
Basically I am trying to perform a benchmarking with 300 requests per second for 100 request to a page. As you can see more than 95% traffic completed in less than a second.

Test2:
/usr/local/apache/bin/ab -n 1000 -c 100 http://67.xx.xx.xx/in/product.php?subcat=33

Test 2 Output:
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 67.xx.xx.xx (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: 67.xx.xx.xx
Server Port: 80

Document Path: /in/product.php?subcat=33
Document Length: 48468 bytes

Concurrency Level: 100
Time taken for tests: 19.444 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 48800000 bytes
HTML transferred: 48468000 bytes
Requests per second: 51.43 [#/sec] (mean)
Time per request: 1944.364 [ms] (mean)
Time per request: 19.444 [ms] (mean, across all concurrent requests)
Transfer rate: 2450.99 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.1 0 4
Processing: 267 1401 2363.5 739 15465
Waiting: 55 515 251.0 472 1910
Total: 271 1401 2364.2 739 15469

Percentage of the requests served within a certain time (ms)
50% 739
66% 857
75% 971
80% 1333
90% 1926
95% 4604
98% 15467
99% 15468
100% 15469 (longest request)
[email protected] [~/public_html]# /usr/local/apache/bin/ab -n 1000 -c 300 http://67.xx.xx.xx/in/product.php?subcat=33
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 67.xx.xx.xx (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: 67.xx.xx.xx
Server Port: 80

Document Path: /in/product.php?subcat=33
Document Length: 48468 bytes

Concurrency Level: 300
Time taken for tests: 27.867 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 49434400 bytes
HTML transferred: 49098084 bytes
Requests per second: 35.88 [#/sec] (mean)
Time per request: 8360.227 [ms] (mean)
Time per request: 27.867 [ms] (mean, across all concurrent requests)
Transfer rate: 1732.34 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 111 354.6 0 3000
Processing: 258 4562 6372.3 1982 27851
Waiting: 52 4278 6246.6 1800 25813
Total: 270 4673 6341.2 2061 27860

Percentage of the requests served within a certain time (ms)
50% 2061
66% 2816
75% 3099
80% 3630
90% 14273
95% 22137
98% 27833
99% 27843
100% 27860 (longest request)

Test 2 Interpretation:
As you can see, for same test if I put the localhost as the server name in the URL, the response time increases to 14 seconds for 90% requests. None of the request is servers in subsecond response.

I feel something is wrong with the network and has to be fixed.
Avatar
Arn
Hello, Thanks for the question. The problem here is that you are request us to go in-depth into your server and look at your settings and also look at how you used the Apache benchmarking tool. This type of request belongs with the live support team as the request will be handled by the systems personnel who monitor and maintain the servers. I did notice that you have a support ticket already submitted. That is the proper avenue for your request. However, I did stop one of our systems people to get their opinion on how you ran the tests and for an opinion about what could be done to improve your tests. He said that first, since you are using PHP to do the benchmarking, you already affecting the results. I was told that you should be benchmarking against static pages. He also said that you could change to FastCGI to help improve performance of the server. This PHP handler's benefit are its strong performance marks versus the suPHP that is standard for VPS. suPHP is the default because it is better for security. Also, keep in mind that VPS servers still basically share a server resources with a small population of others on a hosting server. Although resources are basically "reserved" for your VPS, it is still not the same as having a dedicated server where ALL the resources and the CPU are dedicated to running your website. Also, please note that when you post in the Support Center, it is open to the public. I removed your IP address from the question for purposes of privacy and security. I hope this helps to answer your question. Please let us know if you have any further questions. Regards, Arnel C.