Need help? Chat now!

Hostwinds Blog

Search results for:


How to Fix Your High WordPress CPU Usage Problem Featured Image

How to Fix Your High WordPress CPU Usage Problem

by: Hostwinds Team  /  March 31, 2017


If high WordPress CPU usage problems are driving you insane, this post will help you out. If your site uses too many resources, it's probably making your site run slow for your visitors and affect your rankings. Not to mention the fact that you may be getting warnings from your hosting provider or they may have even suddenly shut you down without warning.

Note: No, we won't shut your site down all of a sudden because your site gets a surge of traffic, and resource usage goes through the roof.

So here we go; here are some of the first things you should look at and consider if you're having constant problems with resource usage or a slow loading site period…

  1. Check your plugins and themes.

Plugins and themes are awesome. They can help you add just about anything you want to your site without having to hire a developer or take on coding yourself. But if you use poorly coded ones or use too many of them, it can take a toll on your site.

Even if you only use a couple at a time, over time, the installing/uninstalling, activating/deactivating of a bunch of plugins or themes can leave rogue, abandoned data just hanging around, eating up bandwidth.

So what do you do? Simple, you stop using them. JOKING! No, seriously, you don't have to do that. But it would help if you did the following…

  1. Only use plugins you absolutely need

If you have plugins or themes laying around that were installed to test them out and you weren't happy with them, get rid of them. If they're sitting around for that "Oh maybe, just in case I want to…" then save the zip files somewhere else and install them when you're actually going to use them.

Note: Before deactivating and deleting a plugin, look for any uninstall feature or readme files. Some plugins have special uninstall procedures to remove them from your site completely.

Tip: Here's an awesome guide to choosing a fast-loading WordPress theme, so you can ensure your theme isn't going to bog down your site from the get-go.

  1. Only use plugins and themes from trusted sources with clean, optimized code.

Many plugins and themes out there are a dime a dozen. They were thrown together by a sloppy or amateur developer. They likely aren't even supported with new versions to keep it up to date with new WordPress versions or newly discovered security vulnerabilities. And unfortunately, some are even developed to be malicious purposefully.

  1. Find plugins potentially eating up resources.

Using your preferred tool for testing page load speed, test your site without your plugins one at a time. Disable a plugin, then test your site. If you find that your site performs much better by disabling a certain one, then you've just identified a potential problem plugin. See if you can find an alternative one that does offers the same features and try that one.

There's also a plugin that can help identify plugins that perform poorly, but it's geared more toward developers: Query Monitor.

Some may wonder why we wouldn't mention P3 (Plugin Performance Profiler), which was once a very popular plugin for doing this. It would analyze your plugins to determine if one or more may blame for slowing down your site and user-friendly. But it hasn't been updated in over two years, and many conversations are going on around the web about it.

There are reports of it breaking sites, locking admin, etc. So we don't recommend it until it gets a new update.

  1. Eliminate Gravatar comment page load delays

Gravatars are awesome. They let your users show their personality, add a genuine touch, and plenty of people are easily identified by their unique gravatars. But there's a problem with using them on your site if you get lots of comments. Each comment will send a request to the servers at Gravatar. So if you have lots of comments on a page, you're going to have lots of calls being transferred back and forth, making that page load slower. Eliminate this with FV Gravatar Cache.

FV Gravatar Cache will cache those images locally, which will reduce the load time on pages with many, many comments…

With one exception: Alec Kinnear from foliovision, the developers of FV Gravatar Cache, warns that if you have bad hosting and/or a site that's overloaded with plugins, etc., then this plugin could actually slow things down.

Also, if you have hundreds of comments already, keep in mind, it can take anywhere from five hours to a couple of days for everything to get cached.

You can grab it from the official WordPress plugins repository here and test it out for yourself.

Tip for reducing CPU server usage for WordPress if you get a lot of comments - FV Gravatar Cache! Click To Tweet

6. Use a caching plugin

A caching plugin will help load content faster that's been served recently. Generally speaking, when someone visits your WordPress site, their browser will fetch the HTML files, which requires PHP scripts to be run or data to be grabbed from the WordPress database.

Luckily, today most browsers are smart enough to keep a "memory" of accessed sites through the browser. This is the cache. A WordPress plugin will save the HTML files that were served so browsers can load them faster without running scripts or grabbing info from databases.

Some caching plugins even work with a content delivery network (see below) or GZIP.

Some popular WP caching plugins to consider are:

  • W3 Total Cache
  • WP Super Cache
  • WP Rocket
  • Comet Cache
  • WP Fastest Cache

7. Get on board with a CDN

Doing this one thing is almost guaranteed to give a boost to your site's performance, and that's using a content delivery network (CDN). Using a CDN, static files, especially media files, are loaded from the CDN servers – not the server you're paying your host for. And chances are, they have servers closer to your visitor.

So it's a win-win. It can be tricky to find a quality CDN that fits your needs and price range since many of them today. But you can use this guide to free CDNs we recently published to get started.

If you'd rather jump straight into a premium, paid options, some to consider are:

  • MaxCDN (Starting at $9/month)
  • Amazon AWS (Limited free plan tier for new members, then pay as you go pricing)
  • KeyCDN (Flat rate, usage-based pricing)
  • WPPronto (Starting at $20/month)
  • CDN77 (Pay as you go pricing)

8. Compress your images

Image compression plays a huge role in how fast your site loads, especially if you have tons of them. Especially today when high-resolution images are the expectation, not the exception. Unfortunately, many of the plugins and services you find today only offer a fraction of the features for free or put a cap on just how much you can use it before you have to start paying.

Yep. Capitalizing on the importance of image compression and optimization is now a thing.

Of course, you could sign up to and use a number of them, bouncing from one to the other throughout the month. But first, let me tell you about Compressor.io – the most underrated tool for image compression, in my opinion. And yes, it gets its own section…

It's completely free, and it's online, so no plugins add more weight to your site, no software to download. You upload an image and watch as it shows you in real-time just how much compression has taken place, then download your newly optimized image.

From my experience, this most often will reduce your image's file size from 40% to 70%, though here and there, I've seen more or less. They claim it can reduce the file size by up to 90%.

Image compression is important for page load speed. From my experience, Compressor shrinks image size 40-70% Click To Tweet.

It supports JPEG, PNG, GIF, and SVG, and you can choose which method you'd like to use for compression: lossless or lossy. Yes, there is a 10MB file size limit… I haven't run into any issues there, though I guess if you're a designer, then you might.

And there's the fact that you do one image at a time, which I'm sure will not be ideal for many people.

Of course, as I said, there are many services and plugins out there for compressing images, though. Here are some other options you might want to explore:

ShortPixel – Free 100 credits per month, then $4.99 per 5,000 credits, no file limit size, and you can bulk optimize images previously uploaded (along with all the thumbnails used for them)

Optimus – Free (only JPEG and PNG images less than 100kb) or paid annually (premium members get access to developer API, no file size restriction, HTTPS connection, and webP conversion)

ImageRecycle – Free trial then starting at $10/month

LazyLoad – Doesn't compress images but only loads them when they're scrolled into view so images not trying to be viewed aren't trying to load, slowing down page speed

BJ Lazy Load – Uses placeholder image on images not coming into view yet, which also works within text widgets and iframes

This may seem like a lot to do, but really… if you do any one or two of the above, you'll probably see better performance for your site. If you do them all, well, you've probably gone and outdone a good chunk of your competitors. If you're still having issues, then it's probably time to talk to your host, as they should be able to help figure out what's going on.

What's the one thing you've done that had the biggest effect on increasing your site's performance?

If you've found this helpful, please share! Or leave a comment here if there's something, in particular, we didn't cover that you'd like to see.

Written by Hostwinds Team  /  March 31, 2017