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
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 reducingpm.max_children = 12
topm.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.