0

Since a few days i recognize that my apache2 is going very slow if it has around 90 current request.

If i do a loader.io test it timeouts for example after 13 successfull requests:

loader.io results http://d.pr/i/S6D1+

What i really wonder about, is that my CPU usage is normal (screenshot while loader test):

htop display http://d.pr/i/kNZ4+

Also my Memory has enough free space.

free -m outputs:

               total       used       free     shared    buffers     cached
  Mem:         24158       6494      17663          0        259       2492
  -/+ buffers/cache:       3742      20416
  Swap:        24574          0      24574

My current apache2 settings:

Timeout 20
KeepAlive On
MaxKeepAliveRequests 75
KeepAliveTimeout 2

<IfModule mpm_prefork_module>
    StartServers          10
    MinSpareServers       10
    MaxSpareServers       30
    ServerLimit           200
    MaxClients            200
    MaxRequestsPerChild   4000
</IfModule>

EDIT:

More Specs as requested:

 OS: Debian 6.0.7 (2.6.32-5-amd64)
 mySQL-Server: 5.5.30-1~dotdeb.0-log (Debian) 
 PHP: 5.3.22-1~dotdeb.0 with Suhosin-Patch (cli)

APC Settings:

; configuration for php apc module
extension=apc.so
apc.enabled=1
apc.shm_size=512M

mySQL Tuning Primer sais also, that everything is ok.

The Site i was testing was a TYPO3 Site with some AJAX on the Startpage.

Just tested the Site on a simple Wordpress on the same Server ( no problems at all )

 Success responses: 3097
 Avg response time: 1503
 Sent from app: 20.86 MB
 Rcvd from loader:  369.10 KB

Testing on this TYPO3 fails early

Any idea why this happens? Even apache2ctl status gets very slow! But the other things on the system acting normal.

Don´t know why this happens after this time.

mgorven
  • 30,036
  • 7
  • 76
  • 121
develth
  • 101
  • 4
  • There are very few things Apache would do which would ever take 6 seconds - you're not telling us the whole story. – symcbean Mar 13 '13 at 23:41
  • As symcbean said, please provide more info. What OS? Is a DB involved? What are you using apache for? (Serving static pages? PHP? ...) Saying "it's slow, see" doen't provide enough information. – David Mar 14 '13 at 03:16

1 Answers1

0

If CPU and memory are ok, you can try changing the value of ServerLimit and MaxClients to a high number, and do the test again . In the htop capture I can see "446 tasks" so it seems that the number of httpd processes are reaching these limits.

But this is just a workaround, the timeouts will appear again after more requests in the test. What do you need to looking for is why the httpd request is taking around 6 seconds, maybe something in the code that is not working fine.

As you say with a simple wordpress site, the tests run fine, so you need to check the application (¿php? , ¿python?) you are testing. In the database, check if there are slow queries (mytop or mtop are good tools) when doing the tests.

hdanniel
  • 4,253
  • 22
  • 25
  • After some config try outs i got that the mysql binlog setting slowed down the whole pages. Thanks again for the hint! – develth Apr 29 '13 at 18:53