Load Testing

Can Your E-Commerce Site Handle Traffic Spikes?

Imagine you have a small boutique shop selling cupcakes located on a narrow street. Parking is limited, there’s only one entryway, and you are the only one working behind the counter.

One day your investment in social media marketing pays off and something you posted goes viral. Suddenly, there are cars jamming the narrow street and a flood of people trying to push in through your door.

The customers who make it in fill your tiny shop and grab all your cupcakes from off the shelf. Now a line forms at the counter. You, as the only one working, are processing sales as quickly as you can, but are soon overwhelmed. You freeze, unable to move or process any more sales.

This is what happens to your server when it experiences sudden, unexpected spikes in traffic. If your bandwidth (the street and doorway allowing the flow of customers to access your store) or your server resources (the single person trying to process all the orders) aren’t big enough to handle the spike, your site crashes.

For an online retailer there is little worse than your site coming to a grinding halt.  Every second of downtime during peak shopping hours will cost you money.

How can you prevent your site from breaking from an influx of traffic?

Two words: Load testing

What Is Load Testing?

Load testing can help prevent this from happening by testing your site to see how much traffic it can handle under specified traffic conditions.  Load testing software and scripts send virtual traffic to your links to see how the site performs and where issues might arise.

Look at Traffic Patterns

The first place to start with load testing is by figuring out your site’s traffic patterns.

  • What was the traffic like during the same period in previous years?
  • What sort of marketing efforts are you planning to make for the holiday season?
  • What days, and what time of day, are you planning email outreach, sales, coupons, big media buys?

If your marketing plans for the 2015 holiday shopping season aren’t much different than the previous year, you can look back at your data and see how the traffic was distributed.

On the days where you had your most successful promotions was the traffic clustered around certain times or spread out across several hours?

Traffic spikes are what you’re looking for here.  A huge surge in traffic all at once is what might cause problems for your site.  Load testing will help determine if you need to increase your server capacity in order to handle the spike.

How to Do Load Testing

Once you have an idea about what sort of traffic, or load, you’re expecting and over what period of time, you can move on to setting up your load test.

Choose a Load Testing Tool

As with many things in life, load testing ain’t free.  There are several options, and what you choose will depend on your technical expertise – and your budget.  At Endertech, we’ve used both LoadImpact and JMeter with great success.

Less Technical, Costs Money

  • LoadImpact – LoadImpact does have a free version, but it only includes 100 VU (virtual users).  In most cases, that probably won’t be very helpful.
    • However, their paid plans aren’t too steep, and they also have a single-test option that might help you out.
    • Pro: tests are easier to set up, virtual users are sent from many different locations so the test results are more accurate.

More Technical, Free

  • JMeter.Apache – JMeter is an open source, Java application designed to load test and measure performance.
    • In order to work with JMeter you need to have a certain level of technical expertise in order to install the application and configure the load tests.

Here are some load testing tools that we haven’t used before, but that might be good alternatives to the above:

  • Neustar – they have subscription and pay-as-you-go pricing.
  • LoadComplete from SmartBear – downloadable, free option for load testing.
  • Multi-Mechanize – an alternative to the JMeter option, Multi-Mechanize uses Python (as opposed to Java) to run test.

Setting Up the Tests

No matter which load testing software you use you’ll need to know what you’re testing and how you want to test it.

  • Which pages are you testing?  Different types of pages have different testing requirements.
    • Static pages will be easier to test.  No additional programming / configuration should be required.
    • Dynamic pages with multiple form fields which need to be submitted are more complex and will require a more technical test set up. This type of test will require a technical touch!
      • Forms have a CSRF token, which is a value that constantly changes.  This token enhances the security of the form to protect against malicious submissions.  Because it changes it can’t be hardcoded when load testing requiring more scripting for tests.

The way tests are set up will depend on which tool you use.  Be sure to check the documentation available for the tool you choose so that your tests will run correctly.