As internet traffic hits all-time highs we should all be thinking about how a spike in traffic to our web properties will be handled.
Whether it’s due to the pandemic or we simply need to get ready for a big online promotion, we should never forge ahead without knowing what our threshold for traffic is.
Performance testing is more nuanced and complex than simply throwing a bunch of traffic at your homepage and seeing how many visitors it takes to break the site. A proper testing strategy must be developed with all the necessary stakeholders.
How does a performance testing strategy look like? I’m glad you asked. Let’s break down all of the considerations you need to make when preparing for a performance test.
Once you’ve identified your high traffic pages and your more vulnerable pages, you can prioritize your testing in this order:
Keep in mind that you may need to script multiple-page scenarios, like a user adding products to their cart and checking out. Tools like Blazemeter (built on top of JMeter) or LoadNinja help with creating automated scripts for that.
Now that you know what pages to focus on, you’ll want to plan to test the pages. You will either want to test on the live site or a staging site.
If you choose the live site you’ll want to be sure to do it after hours (non-peak times) and have the tech team on standby in case something goes wrong. It’s advantageous to use a live environment and experience exactly what your users will experience. However, you’ll risk taking down your live site and losing revenue while it’s down.
One tactic we’ve used in the past with load-balanced environments is to take one web server out of rotation and test it in isolation. You’ll want to be sure all the traffic doesn’t go to the same DB server though, creating a bottleneck and impacting real users. If you choose to test a staging server, do your best to test a real-world scenario.
Your testing could yield false positives and false negatives if your staging site is not as close a copy as possible of your production environment.
Once you’ve established what pages to test and where to test you need to determine how much traffic to throw at it. After all, if the most traffic you expect on the best day ever, is a few thousand visits, there is no sense going overboard. And vice-versa, you don’t want to miss the opportunity to test for your most heavy traffic spikes.
We like to say you want to design the church for Easter Sunday. We use Blazemeter for performance testing, but there are many others. Here is a great article on how to determine your virtual user count:
https://www.blazemeter.com/blog/8-tips-decide-number-concurrent-users-your-test
Once you’ve determined your user counts, you’re ready to create your tests.
**One important note: The issues flagged by these tools may or may not be caused by load (for example, it could be a runaway javascript). So, be sure to test with/without load on the site.
Now you are ready to test your site.
Now you have a roadmap for ensuring that your site is ready for a crush. The actual tools and implementation will depend on your technical environment, but you’ll want to be sure to cover all the bases outlined here.
Go crush your performance testing before your site is crushed by traffic.