Home » Configs » Optimize WordPress to Reduce Load

Optimize WordPress to Reduce Load

Optimize WordPress to reduce load

Is your Wordpress blog crushing your hosting service? Here are some tips to Optimize WordPress to reduce load and reduce CPU throttling!

Optimize WordPress to Reduce Load

 One of my WordPress blogs was crushing my hosting service causing me to migrate to a new host. Even after migrating to the new host, my host was throttling my CPU usage. This forced me to really dig in and find out how to Optimize WordPress to avoid CPU Throttling and reduce load!

I’d been on the same hosting service for about 10 years without any problems, then 3 years ago I started running WordPress (.org, not .com) for my blog(s). Everything was fine until this year, my load was high and really impacting the service of the other customers on the server I was on.

This caused my host to shutdown my other blog, which forced me to bring up a backup copy on a new hosting service to avoid interruptions.

For my new hosting service I chose HostMonster, which came very highly recommended by some colleagues that I really trust! They do offer some good prices. I paid 3 years and it cost me about $4.99/month (they have 12 month, 24 month and 1 month pricing too).

After getting my blog migrated over to HostMonster, I noticed that my load was high enough that I was already being throttled. In the few hours of migration, I had grown very comfortable with HostMonster’s controls and setup, so I wasn’t about to migrated off of my new home!

Buying Some Time

To buy me some time, so I could figure out what the root problem really was, I opted to use a service that would do some caching for me.

For Caching services I had 2 immediate choices:

Sucuri
I had used Sucuri many times in the past and they are awesome. They are typically a security company, but they offer hosting, and automated backups too. I’ve had awesome luck with them in the past.

You can even go to Sucuri and scan your website or blog for malware for FREE!

I was just getting ready to pull the trigger and subscribe to Sucuri, when I noticed that HostMonster provide CloudFlare for Free. Free? Yes, Free.

CloudFlare
I had heard of CloudFlare from some other bloggers and once I saw it was included as part of my HostMonster account, I jumped on it.

I opted to subscribe to the Platinum package, which is NOT free, for a month, while I fought these WordPress issues. I figured if I was paying, there were service level agreements and advanced features to help me tread water in these problems.

Plugins Plugins Plugins

I run a pretty vanilla WordPress blog, so I knew it had to be plugins causing me pain.
I installed P3 (Plugin Performance Profiler) to help see how plugins were impacting my site and load. It showed me the plugins with the heaviest overhead. Even with this awesome plugin, it was still a game of disable, test, re-enable, test again. Blah, what a headache.
Caching Plugins

Many people swear by W3 Total Cache, but it just wasn’t doing much for me, I’m sure it wasn’t hurting, but I saw much better results by using WP Super Cache. WP Super Cache was a game changer, I could see the blog’s load time speed way up, but I was still being throttled.

Edit 12/20/2013:
I’m back on W3 Total Cache, mostly because I opted to use MaxCDN for CDN to speed up my site and reduce the load on my server.

I also have some widgets that show the current list of the 10 most popular posts, and it’s shown on every page. I then added WP Widget Cache. WP Widget Cache also helped quite a bit, since it would cache my widgets. If anything gets weird, I can clear the cache for any widget I need to. This plugin really helped my blog.

Use Google Libraries Plugin

This adds the Google Libraries plugin to your site. It will reduce your page load time. The Google Libraries are served from Google’s servers, and since it’s from Google, it’s compressed and always up to date.

Many of the large sites use these Google Libraries, so it there’s a good chance that your users will already have it cached in their browser, even on the first visit your site.

You really should add this plugin: http://wordpress.org/extend/plugins/use-google-libraries/


Related Posts Plugins

To be honest, I didn’t even consider the related post plugins, until I stumbled onto some support posts about how these plugins can cause serious load issues.
P3 (Plugin Performance Profiler) showed that WordPress Related Posts, was having a huge impact on my site.
This is a great plugin and is pretty much the standard for Related Posts, plugins, but once my blog got more popular, and more views, the related posts plug was really really hurting me. I know others use it without any problems, so I’m not sure what was different about my setup.
I switched to Efficient Related Posts after reading:

Basically, current related post plugins build the list of related posts on the fly when the user needs to view it. Since blogs tend to be viewed far more often than they are updated (often hundreds of times more often), these queries are run way more times than they need to be. This not only wastes CPU cycles, but if the queries are slow (which they will be if you have 1000s of posts and tags) then the user gets a poor experience from slow page loads.
Efficient Related Posts moves all this effort into the admin section, finding related posts when a post is saved rather than when the user views it. The advantage is that if the query is slow it happens less often and the post writer is the one that waits rather than the user (which I think is WAY better). 

Keep in mind that Efficient Related Posts, isn’t as fancy, but at this point, I had no choice, unless I wanted to move from shared hosting to a dedicated server host, which can be very pricey!
Popular Posts Plugins and Widget
I also removed my popular post plugin (and widget). It was doing some queries and sorting every time someone viewed my page, for every view. I really liked this, but I’m doing similar stuff with Jetpack now, so it’s not a total loss.

Other Plugins

I also disable extensions that I wasn’t using, such as Jetpack, which was having a large impact, even though I wasn’t using it.

Edit 12/20/2013:
I re-enabled Jetpack, so I could take advantage of it’s site statistics and commenting system. The comment system, since it leverages social network authentication, has reduced my comment SPAM by a 100-fold. I used to get 1000’s of Spam Comments per day, but I have had 2 since I’ve activated the Jetpack comment plugin.

Optimize WordPress to avoid CPU Throttling and reduce load
You can see how my throttling dropped off instantly when I chose the right plugins for the job!
Lazy Load was helpful, until I started using the paid caching service, CloudFlare, they do a similar technique and both of them together was a little bit weird. Lazy Load worked fine with the free version of CloudFlare, because they don’t include that feature in their free version.
Optimize DB is handy to keep the DB clean and efficient without running MySQL commands. Good housekeeping is really important to blog health and speed.
My blog now loads in about 3 seconds flat, and you can see, in the image above, that once I found the right wordpress plugins for the job, I was able to Optimize WordPress to avoid CPU Throttling and reduce load!
If you want an objective view of your blog or website’s speed:

 

Sucuri Security

 


As an Amazon Associate I earn from qualifying purchases. Read our Privacy Policy for more info.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.