I am constantly experiencing memory outages on my server.

The server is forking and spawning new connections like crazy. I have a VPS with WHM installed.

This is the reply from my host: "The issue appears to be that your server is consistently hitting its memory resources. We've made adjustments already to the common causes such as your dns server spawning a thread for every CPU it sees on the new system, but I'd suggest you look into configuring your server a bit more to minimize memory usage. Your apache server's MaxClients setting seems to be fairly high as well, but was not able to weed through your configuration files to see where it is set."

I entered through shell and tweaked the httpd.conf file a million times changing Maxclients, MaxRequestsPerChild, and MaxKeepAliveRequests all to no avail

I am monitoring using TOP in WHM and the beancounter through putty (shell), and I see a ZILLION memory outages.

I have absolutely NO IDEA what is sucking up all this memory. I have even gone through IP banning to see if robots were sucking up memory, but either I was unable to get the correct info or this is not the issue.

IT/WP/PHP eprt neede BAD


  • there are quite a few questions and answers on here about optimising Apache - in any case, this is probably best dealt with over at serverfault
    – anu
    Apr 20, 2011 at 9:29
  • @anu I suggested he post here from the wp-hackers list. I expect he is having trouble with a plugin. Apr 20, 2011 at 9:36
  • @Fred - please update your question to list the plugins your site uses. Also just ask your question i. Yout title; don't include " Need PHP/wP/IT Expert" here because that is pretty much redundant on this site and adds no value to the title. Apr 20, 2011 at 9:36
  • @MikeSchinkel - ah ok, I didn't see any WordPress references in his question at all, which is why I suggested moving it over to serverfault
    – anu
    Apr 20, 2011 at 9:38
  • @anu - he included "WP" in the title which, ironically I just asked him to remove. Apr 20, 2011 at 9:42

2 Answers 2


On top of caching as many dynamic requests as possible through W3 Total Cache, I also had to modify my PHP configuration to behave nicely on my low memory web server. Before tweaking PHP, it would spawn too many PHP child processes, run out of RAM, hit the swap, and basically shut the entire server down.

I'm running Nginx and PHP5-FPM, but what fixed the problem for me was editing my PHP5-FPM configuration (in /etc/php5/fpm/php5-fpm.conf I believe) and reducing pm.max_children = 12 to pm.max_children = 10. I haven't had any memory issues since making this change.

Your configuration will probably be different, but I'm sure there's are similar configuration values for PHP that you can tweak to reduce memory usage.

To get an idea of what processes are sucking up your memory, use top if available and press SHIFT + M to sort by memory usage. When my server was having issues, I'd see a ton of php processes eating up resources.


You should look at caching the output of your pages using W3 Total Cache either to Disk or to Memcached. By not needing to rebuild your page on each pageview, you'll save the amount of processing and memory required.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.