Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

Thanks

share|improve this question
    
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 '11 at 9:29
    
@anu I suggested he post here from the wp-hackers list. I expect he is having trouble with a plugin. –  MikeSchinkel Apr 20 '11 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. –  MikeSchinkel Apr 20 '11 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 '11 at 9:38
    
@anu - he included "WP" in the title which, ironically I just asked him to remove. –  MikeSchinkel Apr 20 '11 at 9:42
show 3 more comments

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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