WordPress is a great blogging solution, with themes for every type of blog and plugins to make it work. It can sometimes use a tad too much CPU. Heres how to reduce that!
Why?
Firstly, this is a personal post due to this very blog been almost taken down due to “Excessive CPU usage”, and after a substantial amount of time I was allowed in to “remove the threat”. Heres what I did:
- Caching
- Reduce plugins
- Update
Caching
You’ve probably heard of caching and it’s basically where instead of dynamic data a page is ‘saved’ with the current data and is called on later instead of re-reading the database. It can reduce database calls vastly when used in the correct context.
Now, in order for you to get this there are several wordpress plugins, I find WP-Cache to be useful but they all do pretty much the same thing! So just run a search for WP-Cache and you should find it (or click here)! So install it into your wordpress blog and your ready to rock!
Reduce plugins
Plugins are usually the cause of it all. Some can be pretty heavy on your server and so remove those that you don’t need. Not only deactivating, removing – that way if they remove their options in the database on uninstall then they go. Meaning faster database queries. But, don’t stop there – oh no. Do it again – remove the plugins you don’t need (new wordpress versions sometimes replace plugins). Then install the plugin “CleanOptions”, to get rid of old unused database entries stored by plugins.
Update
I generally do not update wordpress, if i’ve modified any files i’ll lose it and my plugins may not work anymore. But – most of the time they include various bug fixes and improvements, meaning your CPU problem might be a global one and this could just be the fix.
And that was most of what I did, obviously you could remove PNG metadata or even host your images on another server such as photobucket or flickr. You might even think about removing whitespace and comments from the wordpress files. It might seem daft but it could just be what you need. Obviously the above tips worked for me – otherwise you couldn’t be reading this!
