My wordpress sites are eating a ton of CPU of my server, and keep getting overloaded. Top Process %CPU 120 /usr/bin/php /home/xxxxx/public_html/index.php Top Process %CPU 101 /usr/bin/php /home/xxxxx/public_html/index.php Top Process %CPU 88 /usr/bin/php /home/xxxxx/public_html/index.php Top Process %CPU 65 /usr/bin/php /home/xxxxx/public_html/index.php Anyone have tips, or can offer their services, in lowering the CPU usage of wordpress? (BTW most sites have W3 Total Cache installed) Thanks!
Have a check at the database & try optimizing it. If you have already made the changes, check the server usage and the processes running. At times, due to other processes consuming more resources, wordpress files have issues too. Check the server configuration as well. If you have access to the server, we will surely be able to help.
I've run analyze + repair + optimize on the databases, but doesn't seem like it helped much. Also tried upgrading MySQL, to support multi-core of my server, but that doesn't seem to have helped much either.
You will want to implement full page caching at the webserver layer, or at the application layer. A plugin such as WP-FFPC might help you. At the webserver layer, you could reverse proxy NGINX to cache for 10 minutes or so, which would alleviate the need to constantly re-fetch data from a database. Yet another option would be to implement object caching with memcache/memcached to keep a cache in memory, which will keep it off the disk, which is the slowest component of any server.
My experience with such problems led to WP plug-ins where the Developer had encrypted them to protect Buyer from seeing the code. Not sure how much of a problem they would be with caching on (because I did both to deal with situation), but, without caching, each time a visitor comes to your blog, the CPU has to grind to unencrypt the code, even though the plugin may have nothing to do with the presented content! So, such plugins are deactivated if possible when not in actual use. Such plugins are avoided like the plague. And, unless a plugin has real reason to be installed, I get rid of it all together. Been doing that with themes too. FYI, the particular Developer that was promoting the plugin I discovered this on was unaware of the problem because... He had his own private server which did not need to share CPU with other accounts! Anyhow, my $0.02 based on experience. Good luck!