Dealing with website traffic spikes – stop your website crashing

Google Analytics screenshot showing large active visitors

Could your website cope with 66 concurrent visitors?

Traffic spikes are (unfortunately) not something that most website owners need to worry about. We all want more traffic, but most websites actually end up with no more than perhaps a few dozen visits per day. This is hardly challenging for most web servers.

However, getting a huge amount of traffic all at once can sometimes do more harm than good to your business – especially if you are unprepared.

Getting a sudden burst of traffic could lead to a poor experience for your visitors just at the wrong moment. It might even result in your site being taken offline.

What can cause traffic spikes?

Usually, website traffic grows gently over time. This gives website owners ample opportunity to take action before the proverbial hits the fan. Occasionally, however, something happens that prompts a lot of people to check out your website all at once, causing a spike in traffic. This could be anything from a successful marketing e-shot, to a prominent mention on TV that identifies your memorable website.

A real life traffic spike example

My client was hit by a traffic surge a few weeks ago, rendering her site unusable for many hours. This resulted in threats to take the site offline altogether by her web hosts. Here’s what happened…

The website had been working quite nicely for many months. Daily traffic had been consistently around 100 unique visitors. To promote a paid membership on the site the owner (let’s call her Olivia) decided to send a large mailshot. She sent a Mailchimp newsletter to 50,000 contacts in her niche, that and had built up over several years. Unlike many mailshots this was highly relevant, with a really compelling offer that was just right for the target audience. Perfect, you might say!

Graph showing massive website traffic spike

Spot the day the marketing email went out!

 

In fact, the mailshot was so successful that within the first hour the website had registered almost 2,000 visits. Things continued at only a slightly lower pace for the rest of the day. Although Olivia recorded lots of membership sales, she was bombarded with complaints from people who failed to get onto the site. Some had partially completed the purchase process before the site died on them. In addition, her website host threatened to take the website offline. This was because she was breaching her hosting agreement by impacting other sites on their shared server.

Image of traffic spike in website

What time of day did the marketing email get sent – I wonder?

 

It’s clear that the Olivia would have made more sales had the site stood up to the spike in traffic.

How to cope with website traffic spikes

Here are 7 things that will make your website more resilient when it gets a spike in traffic…

  1. Install server-side caching – many web development platforms build content on-the-fly, such as WordPress and Joomla. This adds work to the server every time a page is requested. There are plenty of cache plugins and extensions around for these products. These store pre-built page content for a short period of time so that repeated requests for the page don’t need to go through the whole page build process. These are simple to install and can be highly effective;
  2. Get a better server – you need a server that is fit for the job. Shared hosting is fine for small traffic sites (or even medium traffic sites that are well optimised). Ultimately a bigger box with more memory, better systems software, and dedicated resources will be best. Look at a VPS or a dedicated server. A cloud hosting service might also be worth considering. Most allow you to instantly boost the resources available to your website as and when they are needed. Good, professional website hosting can be achieved at a reasonable price;
  3. Make sure your content is rendered quickly – this is important regardless of the volume of traffic you’re getting. Search engines and real visitors prefer websites that load quickly, so make sure you aren’t serving huge images. Simple, but perhaps time consuming to implement;
  4. Use a content delivery network (CDN) – if you have lots of static resources on your site then try using a CDN to distribute the files to various servers around the globe. This will ensure your files are served from the closest point to your visitor’s location and will remove the need for your server to do the work;
  5. Consider Cloudflare – this is effectively a content delivery network, but with the added advantage that your content is optimised and they can also protect your website from malicious attacks. Setup is fairly straightforward, although there are quite a few options to consider (especially with the excellent paid pro- version);
  6. Try compressing your web page content – deliver your web pages as compressed (zipped) files and leave the unzipping to the visitor’s browser. This could really reduce the load on your site AND deliver your content quicker.
  7. If you have a database-driven website (which can include websites that run content management systems such as Joomla, Drupal and WordPress) make sure that the number of concurrent database connections is high enough to cope with your expected traffic. Every time someone visits a website on one of these systems it results in database calls. Usually, there are a limited number of concurrent connections allowed. If this is exceeded the visitor will get a rather brief and unfriendly ‘Too many database connections’ message. Increase the setting for the number of concurrent database connections as much as you can. If you don’t know where to look to increase this, ask your website hosts if they can help. If you expect traffic spikes it’s polite to let your web hosts know, especially if other websites on the server could be affected, but they might also be able to change some server settings or shift resources to help you out;

Of course, depending on your time and budget, these steps are good practice recommendations for any website – even if you only get 100 visitors a day, isn’t it best to deliver the pages they want as fast as possible?

Fast website = Happy visitor = More engagement = More sales!

It’s good for your SEO too

Search engines might just rank you a little higher too, so isn’t it about time you backed up that great content you’re publishing with a website infrastructure that matches it?

Giving precise instructions or suggestions for each point is beyond the scope if this post, but a quick search in Google should give you the information you need…

By the way… did we mention we can get your website performing quicker for you? If you want a faster website (or if you’re just confused with all the options available) then get in touch now and we’ll help out.

Tags: , , , , ,

One Response to “Dealing with website traffic spikes – stop your website crashing”

  1. Anam March 4, 2016 at 9:43 am #

    I just received an email from addthis site advising that my site traffic has spiked and wasn’t sure how to resolve this issue hence I searched on google then found your article. It helped me a lot.

Leave a Reply

We're really pleased you want to comment. As a reward we'll include a link to one of your own blog posts. Write your comment as normal, then we'll display your recent blog posts for you to choose from. Un-check the box to opt out.