A top concern for websites is staying online during spikes in traffic. Businesses spend lots of money from their marketing budget to attract customers to their website, however, if the website cannot handle the amount of traffic it can go offline during these traffic peaks and lose all of the potential revenue from customers in the middle of transactions.
Protect Your Website
section.io now allows for you to set a limit on the number of visitors your site can safely handle to manage your online web traffic more effectively. When your website reaches this limit, an overload page will be displayed to new customers so that they cannot access the website. This allows the existing customers who are actively browsing and transacting on your website to complete their session uninterrupted. When those customers leave the site, additional customers can enter, creating a virtual waiting room or a virtual queue for customers during your biggest spikes in traffic. You can customize the language on your overload page so customers know that they are in line to get access to your website.
Setting Up Traffic Overload Prevention
To use Traffic Overload Prevention on section.io you will need to have a GoSquared Account and Varnish 4 on your section.io application. GoSquared provides analytics so you know how many users are on your website in real-time. Varnish is a reverse proxy that uses rules you create in VCL (Varnish Configuration Language) to manage HTTP requests by caching objects or redirecting users.
section.io will use the real-time analytics from GoSquared to determine the number of users currently on your website. The application will then use Varnish to provide the overload page when your maximum number of users has been set. GoSquared is a seperate service from section.io and has its own pricing, including a free tier. Varnish is a reverse proxy that you can select for your section.io application and is included in all paid plans.
To add Traffic Overload Prevention to your section.io application, check out our docs for instructions.
Determine Your Maximum Users
The next question you may have is, how many users can my website safely serve before going offline? If you have ever been taken offline by extreme traffic before, you should see the tipping point in your metrics. Choosing a maximum number slightly below that will give you a number that you’ve seen your website be able to handle.
If you have not been taken offline before, we recommend analyzing your scalability (ie. how well your website handles increases in traffic) using a tool such as New Relic’s Scalability Analysis to determine how well your website scales. If you see an upward trend in CPU as the number of requests increases, that means your website has trouble handling increased volumes of traffic. You can approximate at what point the number of users would max out your available CPU and set your maximum number of users just below that.
Making Your Website More Scalable
If you feel your maximum number of users is lower than you would like it to be, there is work you can do to improve the scalability of your website. By having Varnish on your website, you can cache more objects which will reduce the work required by your servers. By storing objects in the cache, the server is only hit by a request when the cache needs to be updated. That means users can get their responses handled by the cache, whether there is one user or one thousand, and keeping the work required by your servers low. section.io offers Varnish on all of our plans and section.io’s consulting services can help you identify the best places to optimize the cache to improve your scalability.