9 Tips to Help Your Website Cope With Huge Traffic Spikes

There are times when your website might experience short periods of very high traffic. This could be the result of TV exposure, or your linkbait just hit the front page of Digg. The worst thing that can happen at this point is that your site can’t cope – this becomes a huge missed opportunity.

Here are some tips to help you plan to stay online and available.

1. Use static page cacheing

Use a plugin such as WP-Cache for WordPress. For for a custom coded site, use mod_rewrite to replace your dynamically generated page with a statically built one for the period of the spike, then switch back to dynamic when traffic returns to normal.

2. Use Memcache

Memcache gives you a super-fast alternative to pulling everything out of a database. This is particularly useful on sites which have mostly database reads, and few database writes such as CMS, blogs etc.

3. Keep the page light

If the traffic is going to hit a single page, keep it light. Use a tool like Firebug to check the HTML size and image sizes. Ensure the images are compressed properly, and consider temporarily removing weighty layout blocks or switching to a lightweight template for a while.

4. Split your content over multiple pages

Rather than one large page (which everyone tries to load once, at the same time), split your content over multiple, sequential pages. This will reduce the load into more smaller requests over a longer period.

5. Have a code-tidy

Use this review as an opportunity to reduce the weight of your pages. Look at the code of your pages. Do you still have tables and font tags?  Switch to a div-based layout and CSS. Abstract any in-line CSS and JavaScript into separate files.

6. Host your images/media off-site

If you think you are going to have bandwidth issues, put your images somewhere else – with a different host, on a different network. If you need to choose the host, use tools such as traceroute to ensure they are actually in a different place and network path. Put your video on a sharing service such as Youtube and then embed it in your page.

7. Check your hosting plan for hard limits

You might have been through all the tips above, and the site is performing fine … right up until your host switches your site to a page telling everyone you just exceeded your bandwidth limit! Check what you are paying for and make sure this is enough. Talk to your host to see if the limit can be temporarily removed.

8. Find out about the infrastructure of your host

This is less important if you are with a big, well-known host, but then these people are likely to publish information about their infrastructure and internet pipes anyway. This becomes important is when you are with ‘Bob’s hosting’, and he is hosting you on his rented box with 1,000 other low-bandwidth sites and a throttled internet connection. Is the server capable of supporting a high traffic spike? Does it have a 100M/Gigabit path to the internet?

9. Go dedicated/clustered/grid

You might think you are already paying a handsome price for your hosting, but what is it actually worth to you to stay up? If you were down for an hour at what should be a busy time, what would you stand to loose? In the case of an e-commerce site this should be pretty easy to calculate and you may actually be surprised at what you stand to loose! Look at your hosting cost from this perspective, and it may be that the upgrade to the next level of hosting suddenly looks cheap.

15 comments ↓

#1 Internet Marketing Joy on 09.08.08 at 9:33 pm

These are very helpful tips in helping us avoid huge traffic spikes..^^ thanks a bunch for sharing!

#2 BPO on 09.08.08 at 10:00 pm

thanks for posting this! helpful!

#3 McHow2 on 09.09.08 at 2:54 am

Short and informative. That’s how i like it. The worst thing that can happen is that you spend money and time and once your internet marketing campaign takes off and prospects start to to come to your site, your sever goes down and all the effort was for nothing. Thanks for that

#4 seobro on 09.09.08 at 6:02 am

This is usually when your host shut you down. The contract says 15 terabytes and you only used 100 gigs, but the host claim “Excessive use of bandwidth”

Lets see 100 gig X 30 days = 3,000 gigs, much less than the 15,000 gigs of bandwidth you are permitted.

#5 doumiao on 09.09.08 at 9:26 am

though my website has little change to experience the huge traffic, i enjoy this post, maybe it can help me in the future.

#6 SEO Passionate on 09.09.08 at 12:37 pm

It’s great to read some new and innovative ideas for improving the scalability and performance issues of websites.

Thanks.

#7 Diseño Web on 09.10.08 at 3:32 pm

Really interesting post, but I don´t believe that my business is going to need outside hosting for images.

#8 David Lindop on 09.11.08 at 10:13 am

And we’re not talking about normal thru-traffic either: this is more for those times when your latest blog post hits the BBC homepage as an authority piece, or you get an 800% boost from Digg in a 30-minute period.

The image at the top of this post is around 55KB whereas the basic html is around 18KB. If this ratio is average, that means that you can potentially reduce your bandwidth by around 75% by hosting images externally.

We’re not just talking images though, video and other media can play a big part.

#9 website design on 09.18.08 at 4:33 am

Go dedicated or go home.

#10 stuart on 10.07.08 at 2:36 pm

Anyone thought of Grid Server technology such as at Media Temple? (start the arguements for and against!). Then there’s outsourcing your database to a rented cluster. Then multiple boxes rsync’d….. ARGGHHH Where does it all stop? The bain of my life dealing with ‘What’s gonna happen when we have 10000000 x n users?’ type questions when they’re not even live yet! :D

#11 Rudi on 10.08.08 at 5:26 pm

it’s very helpful tips for my blog.
Thank’s Clark .. Ooo ya. ..

#12 Stuart on 10.18.08 at 1:01 pm

Get the best quality/ size ratio for your images to start with. For example the logo on this page mentioned previously can be reduced in size by 80% without any detectable degradation. That sort of saving is worth its bandwidth in gold on a site with many graphics.

#13 Sam Sutton on 10.27.08 at 12:33 pm

@ Stuart – thanks for pointing that out! I’ve updated that logo with a much smaller version, which as you quite rightly pointed out suffers no noticeable degradation. For the graphics nerds out there, I think the original problem was that I saved the file down as a png32, rather than png8 which is what I usually use for those kind of graphics.

#14 Diseño web madrid on 09.08.09 at 7:16 pm

Dedicated hosting it’s affordable for most business, that’s the best solutions for mid-visitors websites

#15 sandrar on 09.10.09 at 3:20 pm

Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

Leave a Comment