Trying to decide the best ways to protect your site from downtime or slow loading during traffic spikes?
It’s every webmaster’s worst nightmare: a spike in popularity causes traffic that brings your site down, preventing users from accessing your website.
How do you prevent this from happening?
An influx of new visitors to your site is usually a great thing! Every visitor is a potential new customer.
There is just one problem – what if your site can’t handle the new traffic?”
The majority of users will abandon a site if it fails to load within 8 seconds. And even for those who wait, if their experience is laggy and frustrating, it may reflect poorly on your business. Preparing for these types of traffic spikes in advance is key if your reputation is to survive them.
There are a few things you should do – and a few things you should not do.
Let’s take a look at how to prepare for traffic spikes.
Do: Request Increased Capacity Before Spikes, Where Possible
If you are aware that your site might experience an upturn in traffic in a few days or weeks, discuss it with your hosting provider. Ask your host if they can scale up capacity in advance of a spike or what tools they have available to deal with a traffic spike on short notice.
Some hosting providers offer pay-as-you-go servers and bandwidth, allowing you to increase your servers capacity well-before a traffic influx occurs.
However, scaling up your server and bandwidth will not always be a viable option, so it may be beneficial to work out an agreement with your hosting provider regarding the resources needed to scale up your server.
Our VPS Hosting, for example, scales resources up or down as your site requires – you can scale up just before you think your traffic will spike, and then scale down once the spike’s over.
Don’t: Always Run At High-Capacity
It can be tempting to always have your site firing on all cylinders, but doing so will cost you a great deal of money in the long run. But you need to have adequate resources at hand as well.
At any given time, you should only be using the resources you need. Anything else is capital you could invest elsewhere.”
Many times, organizations will fill a server’s hard drive to capacity or max out the memory usage until it’s a problem. When things go wrong on your server, or your website is getting slammed with unexpected traffic, having little to no resources available will come back to bite you.
Whether it is the amount of websites being hosted, the size of your projects filling your disk space, or any other problems that may result in a server’s resources being maximized, it is important to leave a significant percentage of resources available.
This way, you will always be ready for unexpected mishaps and traffic spikes.
Do: Use A CDN
A CDN (Content Delivery Network) allows you to offload certain elements of your site – usually static ones – to locations around the globe. This allows visitors to automatically load static elements from a server closest to them, which can drastically improve load times.
By storing and automatically caching data in multiple locations around the world, page elements load quickly, protecting your server from traffic overload.
Even if you have a powerful server and network provider, using a CDN makes the world a better place by increasing page speed and making usability greater for visitors to your site.
Don’t: Put All Your Eggs In One Basket
You need to be aware that sometimes a system can fail.
All the precautionary measures in the world mean little if your server crashes as a result of an upturn in traffic. You need to make sure that everything is evenly distributed through the use of a tool such as a load balancer. By splitting resource demands across multiple zones and servers, it ensures that no single system is overwhelmed during a traffic spike.
If you are expecting serious amounts of traffic or thousands of sales in a short period of time, load-balancing is the way to go.”
You can run multiple servers simultaneously, where traffic is split on a rule that you define. This way traffic is evenly or appropriately distributed to multiple servers, increasing page speed and leaving users with a great experience.
Do: Compress/Optimize Files, Images, and Cache Pages
Where possible, deliver your web pages as compressed files, leaving a visitor’s browser to deal with decompression. By enabling or configuring compression on your site, files are stored in smaller, compressed formats which are able to be quickly downloaded by user browsers. At that point, the browser automatically decompresses the file and the user is satisfied with a quick-loading website.
Leverage caching plugins like WP Super Cache or W3 Total Cache to cache dynamically-generated (by PHP and MYSQL) pages and posts as static files provides the biggest boost to a server’s ability to handle high volume traffic. It does this by taking resource-intensive PHP and database processing almost entirely out of the equation for front-end traffic.
Static content on your site, such as images should also be compressed. Images can be very large if not sized appropriately, and compressing them can make a dramatic effect on page speed.
Don’t: Go Overboard
There are certain things you should not compress, and a certain point at which you are damaging the quality of an image rather than optimizing it. And in the case of page caching, you need to ensure you account for dynamic content and changes to your site.
Settings need to be appropriately tested. Compression can cause all sorts of issues if it’s not configured properly. While compression is easy to set up and a straightforward process most of the time, certain languages and applications can behave erratically.
Be sure to test everything implemented on your server under multiple circumstances, as this helps to ensure that your website or project works for everyone, everywhere.
Do: Monitor And Analyze Constantly
The best way to prepare yourself for a traffic spike is to have a system in place to notify you that one is coming. To that end, keep a careful watch on how and where users access your site.
Use a real-time monitoring solution that notifies you during periods of high traffic, and be sure to regularly test and examine your site for any bottlenecks that may exist. Try using a waterfall chart with tools like GTMetrix.
Take the time to identify high-volume days of the week and of the month.”
Holidays often slam websites with more sales and traffic than any time of the year. Knowing when these times are for you will save your website from crashing or failing to load for users.
Certain days of the week can be busier than others, and knowing when a product or service launch for your organization is coming will go a long way in ensuring your server continues to run smoothly.
In essence, get to know your traffic patterns.
Don’t: Ignore Potential Bottlenecks
If, in the process of examining your site, you find a performance bottleneck – an image that is too large, a page that has issues loading, or an ad that drags down site performance – do not ignore it.
Any bottlenecks, even potential ones, need to be dealt with immediately, no matter how minor. Because once site traffic starts to increase, even a tiny bottleneck can cause massive issues.”
Certain problems can become exacerbated under specific scenarios that you may be unaware of. A problem script or file may not seem like a big deal for your browser or OS, but can cause unintentional problems for users under different configurations.
When something starts functioning a little buggy, you need to take a closer look at why and what the potential pitfalls are of the failing function.
Now You’re Prepared for Traffic Spikes
There you have it. Follow the guidelines here, and you should be well-prepared for a massive upturn in site visitors.
Don’t forget to keep maintaining your backups and site, too – these facets become especially important during high-traffic periods.
Also, take the extra time to investigate server issues, resource usage, and high-traffic periods in your logs. Be sure your server has more than enough resources to function under extreme stress.
Doing the work and research to prepare for high-volume traffic periods will help your customers stay happy.