Use a caching plugin on wordpress to avoid server load when
If you are on a shared server and you want to prevent your site going down due to massive traffic that comes to your wordpress you may consider installing a plugin that caches your pages.
WordPress is keeping all the data into a mysql database. The database connections are very slow sometimes and use the server resources more than they should.
Normal usage of blog won’t get your servers down, for example 5-10k views/day are a normal amount for every shared server, but spikes in traffic may appear. If one of your articles will be featured on a high traffic social bookmarking site, or on a popular blog you will see between 10k in a hour, and probably your shared server won’t be able to face it.
The problem is not that the server’s internet connection is so low. The problem comes from the Mysql database which is the slowest in the whole process: HTTP – PHP – Mysql. The HTTP is the protocol which serves the page to your readers. PHP is the programming language that pre-process data that is sent, and Mysql is the medium where the data is stored.
To prevent this from happening, smart people created cache plugins that for every page and every article withing your blog a simple static html page will be created locally. This means that when a user request one of your pages, the PHP and Mysql won’t have to work anymore. They will work only when you update something, when you publish a new post, or someone makes a comment. When something changes the static pages are created again.
The most popular plugin for caching is WP Super Cache. You have only to install it and it will start caching pages. Some server permissions changes should be made to make it work. In many cases this won’t be needed if your server is set-up properly.
After you install the plugin watch warning messages that may appear at your administration panel, or on wp super cache settings page.
If the problem is related to .htaccess writing problem, you may have to manually change it. Scroll down on the wp super cache settings page and you will see the Mod Rewrite Rules that you have to copy and paste into your .htaccess file in the root of your wordpress installation.
For any questions or problems in setting wp super cache refer to plugin homepage or ask me using the comment form below and i will gladly help you.
Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the item, I will receive an affiliate commission
March 14th, 2010 at 5:33 pm
Great post Lucian. Of course that at some stage caching will not be enough to save the situation when in shared hosting, that is if the traffic rises above a certain level, but it can definitely reduce the bandwidth load on the server.
March 14th, 2010 at 5:46 pm
You’re right, a shared server will fail at high load no matter what. But while the server can serve html files at a high speed 1-2MB/sec depending on the hosting company, mysql can’t serve data with more than few hundreds of kilobytes due to processing issues.
I like the tools at http://loadimpact.com/ , you can stress test your website to see if will be able to sustain 20,40 or 100 simultaneous connections.
March 14th, 2010 at 6:38 pm
Nice tool this loadimpact! I’ll sure use it, thanks
March 15th, 2010 at 2:25 am
You are absolutely right, this plugin very helpful, thanks for sharing loadimapct which was unknown to me
March 15th, 2010 at 9:14 am
[…] if you have wordpress those processes can really slow down your website. That can be fixed with a caching plugin, but the transfer speed can’t be […]
March 15th, 2010 at 12:00 pm
I’m using “Hyper cache” WP plugin for the very same purpose and I find it quite efficient!