Sometimes you put so much effort into making your website scalable, efficient and optimized that you start seeing diminishing returns. Sometimes you need to literally think outside the box, or in this case, the server. A Content Delivery Network (CDN) would get us past these limits by putting less pressure on the one web server. If you don’t know much about a CDN, take a look at Dan’s blog post.

The Web Performance Lab recently partnered up with Delivergood (a charity supply distributor) to accept the challenge of getting their Magento web store to handle up to 2,000 real-time users.

You might ask yourself, what is Magento? Magento is an open source ecommerce web app that makes managing an online store easy. The service includes PayPal and Google Checkout out-of-the-box, so it is possible for anyone to create a web store of their very own. Delivergood uses Magento for their store’s frontend, so that is what we tested.

WebPerfLab’s approach was to transfer Delivergood’s catalog database to our own Elastic Cloud Computing (EC2) testing environment that was running Magento. From there, we could load test safely without worrying about irreversibly breaking anything on Delivergood’s servers. We did this by duplicating the database of Delivergood’s store, and importing it into our EC2. Also, we set up the EC2 to have near equivalent hardware specifications for Delivergood.

Then came the CDN: while we are aware that there are other CDN providers, we chose Cloudfront because it was convenient (account and billing already set up). Once we created our own distribution network from our EC2 origin server, we were ready for load testing. The first results didn’t look great, but that was only because we were still making HTTP requests via the EC2.

The second and third tests finally gave us the results we were looking for. By requesting that all content be served via a CDN, our max user base skyrocketed. In the control test, the EC2 could maintain about 250 vusers before receiving a 100% error rate. After Cloudfront… the number of vusers jumped to 2,000 comfortably (Test #1) and then up to 5,000 vusers (Test #2) for our third test. That’s almost a nineteen fold increase in sustainable vusers!

Again at 5,000 vusers!

The EC2 Magento server didn’t crash in either of these two test cases. This can be seen visually in the graph because the throughput and requests never show a sharp drop in performance. At the end of Test #2, it might appear as though the server is “failing”. In reality though, Loadstorm was just collecting data after the test had effectively ended, so we don’t consider the very end of that test. From this data, we can linearly approximate our average page response time over the duration of the test for the vusers.

Depending on the use case of your website, CDN implementation would be a sure-fire way to make your site scale with sudden increases in traffic at a reasonable price. For Delivergood, they wanted a reliable web store that could handle up to 2,000 users comfortably and Cloudfront offers that to them. A CDN allows small, humble Magento web stores to stand toe-to-toe with the big budget e-commerce giants. So if your website depends heavily on image content (as Delivergood’s store does), then a CDN is recommended, perhaps required, for a website with true scalability.

Similar Posts