Httpd – Apache httpd response time increase with concurrent connections

apache-2.2concurrencyhttpd

I know many questions have been asked on this subject, but I didn't find an answer to help me.

I'm trying to have Apache httpd answer 200 concurrent connections. I'm testing with jMeter, fetching a small static text file (about 100 bytes), using prefork; MaxClient & ServerLimit at 500, neither memory or CPU are limiting (both are under 50%), bandwidth is 1Gbps.

  • if I start only one connection, the response time is about 7ms
  • if I start a few concurrent connections (let's say 2 or 3), the response time goes to 70ms
  • if I start a little more (let's say 20), the reponse time is over 2s even for the first connection

Using keep-alive doesn't change much. Restarting httpd doesn't help neither.

Am I doing something wrong? how can I fix that?

Thanks in advance

greg

Best Answer

To solve the problem I had to permanently increase the number of running processes. Instead of:

StartServers          5
MinSpareServers       5
MaxSpareServers      10

I changed to:

StartServers        300
MinSpareServers     300
MaxSpareServers     300

Now the response times are acceptable. It seems creating/killing processus is very heavy even for fast computers...