Zombie php processes, high load

Discussion in 'General' started by maxxer, Jun 10, 2014.

  1. maxxer

    maxxer Member

    I'm sucessfully using ISPConfig on Ubuntu 12.04 on two servers.
    On one of the two servers is more busy than the other, and from time to time I experience massive slowdown: sadly I still have to precisely understand what causes the slowdown, but it seems some PHP processes (I'm running php with fcgi) becomes zombie, probably because they massively swap. After some time those processes are killed and system returns to normal.
    The problem is that during this "chaos" the server load bumps to 80+, so all sites become unresponsive.
    The server normally runs smoothly, load is below 1, ram ~2G taken on the 8G available.
    I tried changing swappiness in order to better use ram but it didn't seem to solve, PHP still get crazy sometimes.

    Anyone having similar problems? Any possible cause or solution?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    First, check which website is causing the load.you can see this in the ps output. The username that runs the php-fcgi process contains the Id of the website, e.g. web5 or web22. Then check the access and error.log log of this site to find ou the reason for the massive requests. If many requests come from the saem IP, then it might be some kind of dos. In this case, install e.g. apache mod_evasive.

    You might also tune your server to handle more load by optimizing mysql with mysqltuner and ensure that xcache or apc is installed.

    Another option is tolimit the number of apache childs and max. clients per child in apache2.conf file.
  3. maxxer

    maxxer Member

    Thanks, I will check those options.

    I'm doing this periodically, so on the MySQL side optimizations should be ok

    I don't think this would be a benefit, the server look well powered to handle the normal load. Also I have this "zombie" issue on another server configured in fcgi, I guess there's something else (I still haven't figured out!).

    Thanks so far
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    I dont think its a fcgi issue, at least if you use the normal ispconfig setup as this is used on so many servers without issues. The most likely reason for the accumulation of php-fcgi processes is that they are waiting for something. e.g. when they try to load data from mysql but mysql is overloadedcand cant handle the amount of requests, then more and more fcgi processes will get created as the older ones are still waiting for something so they cant be reused. The reason can be other things then mysql as well, e.g. if your site tries to load content with a php tcp socket connection from somewhere else and this external server is so slow that the fcgi processes have to wait until they timeout.
  5. maxxer

    maxxer Member

    thanks for the suggestions, I'll look at it all more carefully
  6. maxxer

    maxxer Member

    Found out to be a cracked wordpress site with thousands of comments in a single page. php-fgci was taking very long to load a single page, so when multiple requests were done it would kill the server. Disabling this site solved the problem.

    Is there any app or howto to monitor resource usage by domain? I've seen it's possible to do something like that with cgroups and other tools, but has anyone done something related to ISPConfig on this side?

Share This Page