cpu
Credit: BigStockPhoto.com

How to Decrease CPU Usage for a WordPress Blog

cpu
Credit: BigStockPhoto.com

Sometimes WordPress blogs — especially ones with large databases or a lot of plugins — can put too much of a burden on a host’s server’s CPU. That can be especially true if that WordPress blog is on a shared hosting account. And when these blogs become too resource-intensive, hosts often suspend or throttle the accounts, even though the site otherwise is still far too small to truly require VPS or dedicated hosting options. These limitations are often in place because Web hosts overload servers with many accounts under promises of unlimited hosting (unlimited space and bandwidth, but not unlimited when it comes to other resources like CPU).

I’ve had problems with multiple hosts over the last several months due to CPU usage issues with one blog in particular. And while I’ve decided to move that site to dedicated hosting in a few months’ time, I did discover some tips and tricks for decreasing CPU usage in the meantime. Today I’d like to share some of those tips with you, in case you also find your hosting account throttled or suspended and you need quick solutions.

5 tips for Decreasing CPU Usage for WordPress Blogs

Here are five things that might help you decrease the CPU usage of your WordPress blogs. Please note that they won’t all work for all blogs — it will depend on what problem is causing the high CPU usage to begin with, and that will vary from one blog to another.

  1. Repair / Optimize your database — I’ve heard that others have had success taking a few minutes to head into PHPMyAdmin and run repair and optimization on their WordPress databases. It didn’t have much of an effect for me personally, but if there are problems with your database it could certainly be affecting your resource usage. It’s a simple fix, so give this is a try first. Just remember to back up your database before you do any work on it in case you run into trouble.
  2. database
    Is an unruly database holding you down? - Credit: BigStockPhoto.com

    Decrease your database size. — Sometimes when you delete plugins, their database tables aren’t automatically removed. Deleting these can help you decrease your overall database size to help you optimize database issues that could be causing high CPU usage. You can also disable the automatically saved drafts that WordPress keeps by default (don’t forget to delete the past revisions too). Every draft saved counts as a new post in the database, and they can really add up. Disabling this cut my database size by 60%. Just remember to optimize your database after making any changes like this. And again, create a database backup before playing with the database in any way.

  3. Check your plugins. — Only two things I tried had any effect on decreasing my own CPU usage. Disabling a plugin was one of them. If you have plugins that need to search all of your posts (like a related post plugin), it could be the culprit. Disable it and then check your throttling again. If you can’t check your CPU usage yourself, call your host and ask them if there’s been a difference since making the change. Not that plugin? Disable them all one by one then to see if any are causing issues. When you find the offender, remove it completely or find an alternative plugin that won’t make your site quite so resource-intensive.
  4. Look for unusual bot / spider activity. — If your site is large and being crawled frequently by spiders and bots, that could be contributing to your high CPU usage. You can slow down their crawl speed (in the case of spiders like Yahoo’s), or you can block problem bots.
  5. Install a cache plugin. — Install a caching plugin like WP Super Cache or W3 Total Cache. These allow your pages and posts to be saved as static HTML files, reducing your blog’s CPU usage. I’ve seen some minor improvements using W3 Total Cache. Just remember, you can’t activate the plugin and expect to see immediate results. You need to configure them to fully optimize them. You can find instructions for using both of these plugins at the links above.

Unfortunately there’s no magic bullet for heavy CPU usage from your WordPress blog. But there are quite a few solutions you can try. Because WordPress users often pull from different third party sources like plugin creators, you’ll need to look at your individual stats and test your individual plugins to find out what’s causing the biggest issues for your blog. Good luck. Here’s to no more throttling!

Written by
Jennifer Mattern
Join the discussion

4 comments
  • There are quite a few of your recommendations listed here that are handled by the W3 Total Cache plugin like combining and enhancing the CSS and Javascript files. They have really made some serious advances with this plugin, not to mention the use if a CDN which can really speed up your site.

    • I know a lot of people have had luck with that plugin. I tried that and another caching plugin in the past for my main blog and unfortunately they caused a lot of problems with custom features so I had to disable them.

      When I moved my main site to a dedicated account and could really track the CPU usage I was shocked by how low it was. It just goes to show that some shared hosts really aren’t equipped to handle the sites they host. Just another negative result of overselling. Some handle it fine. Others can’t seem to (Bluehost was the worst I experienced with shared hosting and CPU problems).

  • Thanks Jennifer.

    Another tip that helps with high CPU usage for wordpress sites is to use a service like CloudFlare to periodically cache your site and distribute it onto other servers (thereby freeing up the CPU your site is using up on your own hosting plan).

    It’s already made a big difference for me on one site.

    • Good tip Mark. 🙂

      I haven’t had a chance to play with the latest WP update much yet, but I’ve heard they eliminated some redundancies that might help with some speed issues. Have you upgraded yet? And if so, have you seen any improvements as a result? Unfortunately I won’t have a chance to really dig into it until the New Year personally.