Why is concurrency level not as high as expected when load testing Apache2 with "ab" ?

Go To StackoverFlow.com

0

I am running Apache2/PHP on my CentOS 5.8 VPS server (2GB RAM, 2GHz processor) and I tried to do a basic load test. Since I am using the standard installation of Apache I assume that prefork model is the one being used. Here is the config:

<IfModule prefork.c>
StartServers      20
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>

I did a short test with ab:

ab -q -c 100 -n 10000 mysite.com

In the same time I was checking mysite.com/server-status and I've never seen the number of requests currently being processed exceeding 10. How is this possible ?

According to my calculations the number of concurrent request should have been more than 10, ideally 100. Am I missing something here or Apache 2 server-status is reporting wrong ?

Thank you all.

2012-04-05 20:01
by user337620
Unfortunately the exact environment used when I originally reported the problem is no longer available so I cannot post any configuration - user337620 2013-02-17 19:21


0

You are correct that you could see more than 10 requests. You could in fact get more 256 concurrent requests being processed.

However, there's not enough information here to say why you didn't see more than 10 connections. Here are some possibilities:

  • A slow connection to the host being tested could reduce the number of parallel connections.
  • A slow application behind the URL being tested could reduce the number of parallel connections
  • Limitations in the /client/ could limit the number of the parallel connections. "ab" should provide some reporting on what level of concurrency it was able to achieve.
  • You could accidentally be setting "MaxClients" to a lower value elsewhere in your Apache configuration
  • ... or you could have some other Apache configuration problem.

To provide a more specific answer, you could consider posting complete-as-possible copies of your "ab" output and the entire Apache configuration.

2013-01-03 01:38
by Mark Stosberg
Ads