I have been running WordPress for quite some time now and have gone from around a dozen visitors per day to around 2000 per day. I have also had the privilege of having 8 of my applications submitted to Digg, with 1 of them making the front page and receiving over 1400 Diggs. Along with Digg I have also been featured on Lifehacker numerous times, and many other sites. Dealing with the steady traffic is quite easy if you have a good hosting provider, but dealing with sudden and unexpected traffic spikes can prove disastrous without the right supporting software and hardware. Once your site has made it to the front page of a popular website you have 1 chance to accept that traffic. If your website can’t handle that traffic then too bad, those people aren’t coming back tomorrow. Now is your chance to shine, so you’d better be ready. Here are the things that helped me weather my traffic storms.
1. WP Super Cache Plugin for WordPress (or the WP-Cache Plugin)
This plugin saved my butt the first time I got Dugg. I had been messing around with WP-Cache as a way to try and save a few CPU cycles on my already overworked web server, then bam, I got Dugg. The traffic flooded in and the server never broke a sweat. These caching plugins are pure gold. They work by generating a dynamic page just once, saving the resulting HTML as a static file, then serving up that pre-generated page instead of hitting the database again and again for the same content. Genius!
If you’re hosted by some cut-rate provider, and stuffed onto a server with 100 other websites, you’re probably not going to do so well with a traffic spike. Assuming your web host doesn’t disable or suspend your account because of excessive CPU usage, your server probably won’t be able to keep up with the increased requests. About a year ago I moved my all of my websites onto my new “virtual private server” (VPS), hosted by Rackforce. I went with their cheapest Windows option and it has proved to be the best decision I could have made for my web hosting. They are affordable and I have experienced virtually no downtime. I get my own virtual server, but the best part is they tell you what hardware you’re running on, and how many other virtual servers you’re sharing with. In my case I’m sharing with 4 other people, and even at the height of my biggest traffic spike, my server’s CPU never went above 25%. It just cruised along quietly filling requests on my 10mb unmetered connection. I can’t thank Rackforce enough for their amazing support, and their extremely reliable servers.
3. PHP with FastCGI for IIS
PHP running on IIS 6 is a real pig. It’s slow, and uses lots of memory. Not good. Normally PHP running on IIS spawns a PHP process for each request, completes the request then closes. This takes a crazy amount of time and CPU cycles for each request. Enter FastCGI. It’s an awesome little utility for IIS that spawns a set number of PHP processes then keeps them running to handle requests. That way there is always a PHP process waiting to work, and I don’t have to wait for it to start up or shut down. FastCGI is the best thing to happen to PHP on IIS since… well, it’s the best thing ever.
4. Have a Lightweight Wordpress Theme
I can’t stress how important it is to have a lightweight theme. If your theme is built using 100 sliced up images, you had better have a fantastic server. Let’s say that you get Dugg, and you receive 2000 visitors per hour. None of these visitors will have any of those images cached, and none ever will. 99% of the Digg traffic just comes to check out that 1 page. So that means your server needs to be able to handle 200,000 requests per hour (or 55 requests per second) AND still handle and process requests for dynamic content, like PHP pages. Now what if your site only needs 31 requests to build the complete page, like mine currently does? That means that your server only needs to be able to handle less than 20 requests per second. That is a substantial difference, and something that you should consider. To help you test how lightweight your site currently is, I would recommend using the Web Page Analyzer. It’s a handy little tool that will tell you total page size, number of requests and the size of each requested item. You can see which images you’re wasting bandwidth on, which CSS files could be merged into 1 request and many other useful things.
I hope this has helped you get some ideas on how to traffic-proof your server. Remember, you don’t always need to spend a lot of money to handle a high traffic volume, you just need the right tools.









June 17th, 2008 at 9:53 am
good article on worpress. it’s useful for me because i m new in wordpress. it’s great info about live Traffic Spike with Wordpress. it’s really great tools in wordpress site…..thxxx…….