How to use Cloudflare with Agility to Handle Traffic Spikes

By Joel Varty Jan 15, 2019

We spend a lot of time and hard work to try and drive traffic to our websites. Sometimes it works, with that perfect shout out on Instagram from a major influencer, or a celebrity re-tweet, or it could just be a case where your content has gone viral. Sometimes it pays off so well you run into a situation where your web traffic instantly spikes to a thousand times higher than you expect.

One of our customers experienced that when they had a major announcement about their Olympic hockey team. It caught everyone off guard and it took some time for the site to autoscale out to where it needed to be to handle that traffic. In a cloud-based world, it's nice to have the scale ready when you need it, but a vast majority of the traffic might happen in only a few minutes. If the website isn't responsive with sub-second load times, you might just lose that audience you've worked so hard to acquire.

Enter Cloudflare - the agile CDN that's perfect for handling these kinds of traffic spikes. Actually, calling Cloudflare merely a "CDN" is a bit misleading, as it also serves a Web Application Firewall (WAF), provides DDoS protection and perhaps most interestingly, has a unique feature called "Workers" that allows you to write simple Javascript logic that runs right on their Edge servers.

Our customer wanted to add up-to-the-minute game stats and news on their site, which provided a particular development challenge for their implementation partner. The original version of the website didn't handle these live stats, and it would take a major code rewrite to handle these stats.

I suggested using Cloudflare, and my team personally took on the challenge of configuring and coding the "Workers" in Javascript, as we found them a really interesting technology. The customer signed up for a "Pro" Cloudflare account - only $20 a month, and we added support for
"Workers" - an additional $5 a month.

The results were immediate and amazing. Our customer was able to redirect their traffic on their Agility website to Cloudflare, with the live stats pages only being cached for 1 minute. The home page and the news pages are cached for 5 minutes, and the rest of the site is cached based on default settings, which is much longer.

How did things turn out? Pretty great, just check out the numbers!

Nominal traffic on this website is about 100k daily views from 40k user. Previously, our partner had seen the server CPUs flatline at 100% when the number of views hit 500k. Well, after putting Cloudflare in place during a popular game this past month, we saw traffic hit nearly 1.5 million daily views, with over 550k users hitting the site in a 24-hour period. Response time on the site stayed quick with sub-second response on over 98% of requests. What's even better? The CPUs on the web servers hovered around 25-30%.

Want to know more about how Agility and Cloudflare work together?

Talk to us!

Category(s):