During the holidays, people will buy for several billions dollars on internet. Customers are looking for the best deals. They don’t shop, they hunt like predators. Then, they stumble on your website ready to buy your product, now! Only to find out that your website is down in the middle of the transaction.

 

As an entrepreneur, you work hard to attract new customers. It’s frustrating to realize that you just lost a sale because your website was throwing an error message. Your website can also deliver professional performance to your customers.

 

I’ll show you how.

A world map of all Cloudflare's data centers
A world map of all Cloudflare’s data centers

The website is down

Your website is a way for your customers to connect with your business. It must be available at all time. Even when you receive a spike of users. And, especially during a marketing campaign. Availability is not the only criteria for success. It must be blazing fast.

 

You have only one weapon against the fatal website server slowness. Preparation!

 

Here’s what happened to Frank one of my client.

Frank developed a B2C web based solution with 2 co-founders. His startup is finishing the prototype with the money from a first A round investment. It’s an e-commerce platform built on a dynamic web framework. The prototype looks amazing. The website has all the expected features from an e-commerce platform.

They got a new round of investment and they will use a big chunk of the money for advertising their business idea. One of their marketing strategy expects to receive several burst of several thousands users on their website. Frank wanted to know how fast the website is when there are many users at the same time.

 

Frank, How many simultaneous users can your website support?

Frank contacted me and explained me his situation. I advised him that we should first run a load test of the website. Frank agreed and we tested a development version of his website in the cloud. Here is what we found out.

Graph with bad response time
Graph showing bad response time from a website without optimization

The 2 minutes load test showed us that as soon as we hit 100 simultaneous users, the website took 10 seconds or more to answer. We even got 55 failed requests.

Frank starts to panic because they invested a lot of money in the new marketing campaign and the website is too slow for the number of expected users. They can’t step back or postponed the campaign. It’s friday afternoon and the ads will start next Thursday. There are only 6 days left!

One man’s nightmare is another man’s dream

Frank panics but I fly. As a cloud network engineer coming from the online video game industry, this is the kind of adrenaline that we are looking for. I explained to Frank to not worry because we have plenty of time.

Frank asked me why his website becomes so slow when there are more than 100 users. He even rented one of Amazon’s biggest EC2 instance. It has 16 cpu cores and 64 GB of RAM. I explained him that it’s normal for dynamic website like e-commerce or blog to be slower when the number of users increase. The website has to render a dynamic version of the page for each user and more cpu will not solve the problem.

 

It’s like an artist creating a piece of art for each new customer. The client waits a long time before receiving the order.

 

Dynamic content is beautiful but always slower than static content.

Frank asked me how can we improve the speed of his slow dynamic website? I told him it’s easy. We will cache a static version of his dynamic website. The trick is to prepare all the dynamic webpages ahead and to save them into a static cache. This cache is available very quickly to the users.

 

It’s like an artist creating many copies of art in advance and selling them to the client. The client is served instantly without waiting.

 

Frank was very curious and he asked me how can they host a static version of their dynamic website? I asked him, do you know Cloudflare?

How cloudflare works?
How cloudflare works?

Cloudflares has several data centers in all the biggest cities in the world. When you configure Cloudflare, it will sit between your customers and your website. When your customers browse your website, they will connect with Cloudflare’s closest server. They will then receive a static version of your dynamic website taken from the cache. The advantages is that your website will respond faster and will support a much greater number of simultaneous users.

 

Cloudflare makes your websites faster and safer.

 

I said Frank, listen: When we configure Cloudflare, your website becomes 100 servers spread in all the biggest cities in the world. For free! Look at the world map.

A world map of all Cloudflare's data centers
A world map of all Cloudflare’s data centers

I could feel that Frank restarted to be enthusiast. I believe that he is living a lot of pressure recently and technology should not be a source of stress. Technology should be view like a set of tools that help your business grow more efficiently and move faster over your competition.

We spent the next few hours configuring Cloudflare on the test version. We ran a new load test and here is what we discovered.

Graph showing good response time from a Cloudflare protected website
Graph showing good response time from a Cloudflare protected website

Frank was crazy of joy. It’s early Friday afternoon and the marketing campaign is saved. The website answers under 75 ms! There is not a single failed connection even with 2500 simultaneous users!

Down the rabbit hole we went

I told Frank to not get excited too quick. It’s true that now the website is very fast and reliable. But we don’t know yet if Cloudflare broke one of the many dynamic features of the e-commerce platform. I advised him to test as much as possible and that we could meet again on Sunday evening.

Sunday Frank told me that he has a good and a bad news. The good news is that the website seems to work well with Cloudflare. The bad news is that 1 important feature is in fact broken. If a customer adds an item to the shopping cart and browse to another page, the shopping cart returns empty to 0 item. You know the little cart in the upper right corner showing how much items you add?

Static or dynamic?

We figured out that the static version cached by Cloudflare was always showing an empty shopping cart. Frank feels like he is so close to the success and at the same time so far.

I told him, that we can fix it. Let’s ask a developer to write an ajax function that will update the shopping cart with an asynchronous call. This way the shopping cart will be updated 1 second after the page is loaded.

Static then dynamic

You first load a quick static version. Then you update some parts of the webpage with dynamic asynchronous calls. It’s a static website with dynamic updates. It’s very trendy these days.

Frank doesn’t have a developer anymore, so I advised him to ask on Fiverr. He should ask a freelancer to write an ajax call for his website.

 

Fiverr is a place where you can find the Freelancer You Love & Get The Job Done! Browse. Buy. Done.

 

It took 1 hour to the freelancer to develop the ajax function. We deployed it and we ran some final tests. Everything is perfect. We are both extremely happy that we made it.

Congratulations Frank!

The website was fixed and Frank had a very smooth marketing campaign. They had thousand of visits per minute and even spikes of 600 simultaneous users!

 

Frank thanked me many times because their marketing campaign was a success.

 

With Cloudlare, their website could support more simultaneous users and also serve them faster.

  1. He also told me they significantly reduced their cloud costs with Cloudflare caching technology.
  2. He was also surprise to notice his website remained online even if they shutdown the web server for maintenance.

The technology was transparent for Frank during the campaign. He could focus on what really matters to him and the founders; The business and the satisfaction of the new clients subscribing.

 

You can also have a very fast and reliable website by using Cloudflare. It’s not very difficult to setup, but there are a few critical steps that a lof of people mess up. Make sure you work with a professional to enjoy the best features.

 

Here’s my final tip for having a fast and reliable website. Don’t wait till the last minute to start testing and optimizing your website. There are always unplanned issues.

 

Thanks for reading! Make sure to test and optimize the performance of your website with your free load test.

Easiest way to improve your Website performance