Introduction to Load Testing
Large traffic spikes can occur when you launch a new product or feature, run a successful marketing campaign, or get featured on a prominent site. Sometimes, traffic spikes happen randomly for no apparent reason at all.
If your site handles the traffic gracefully and delivers a good experience to all those users, the flood of traffic can be a smashing success. On the other hand, if your site fails to perform well, it can be an embarrassing failure.
High traffic events raise the stakes for your business. They present a unique opportunity, but they also carry risk.
Reducing Risk from High Traffic Events
So, can we be proactive and reduce the potential downside risk of high traffic events?
Load testing is a way to do exactly that. By simulating heavy traffic ahead of time, you can prepare for it, so you can know in advance how your site will respond to a flood of real users.
Load and stress testing can help you answer questions like these:
- Will my site perform well on the busiest day of the year?
- Do I have sufficient hardware or cloud infrastructure to run my application effectively?
- Am I making good use of autoscaling, if hosted on the cloud?
- Does my application deliver quick response times and a good user experience even under peak load?
- When pushed to the limit, does my application crash hard and lose data?
- Are there concurrency issues in my application that only appear under heavy load?
- Do I have memory leaks and other issues that appear over an extended period of usage?
- Are my redundancy and failover systems in place and working properly?
Unlike functional testing, which can be accomplished by a single user, load testing requires special tools to simulate hundreds or thousands of concurrent users interacting with your application in a realistic way. Loadster is one of those tools.
Loadster is designed to load test websites, web applications, and APIs. For the sake of brevity, in this manual we will often refer to them categorically as “sites”.
Answering the Important Questions
Anyone with an important site should have specific requirements for how many concurrent users the site should be expected to handle, and what kind of end user response times are acceptable.
That said, load testing techniques can be useful even if you don’t have specific performance or scalability requirements.
Especially in the early stages of a project, it can be incredibly useful to run some exploratory load tests to see what bottlenecks are encountered. Running load tests in rapid succession, while making changes to the site and environment, is a great way to find obvious and not-so-obvious performance problems.
Tuning an existing website, web application, or API to perform better is one of the best ways to add value. But don’t operate in the dark! Create a repeatable load test to simulate the same user behavior with the same amount of load each time, so you can accurately compare performance before and after each change.
Performance Regression Testing
If you’re constantly releasing changes to your web apps, like most software teams, you’ll want to know if each successive change makes performance better or worse. Running the same load test against each build lets you compare high-level performance metrics to see if performance has improved or degraded. For the most timely feedback of all, add Loadster to your continuous integration pipeline and get automatic performance test results from each build!
If the system receives a temporary spike in volume, does it handle the spike gracefully and recover properly afterwards? Or does it remain in a broken state afterwards? It’s not uncommon for web applications to suffer bad performance for a while or even indefinitely after a large spike in traffic.
All systems have a breaking point. When you’re building and maintaining a complex system such as a web application or API, it’s important to know exactly what happens when it’s put under stress by heavy traffic. Do transactions intermittently fail, leaving the system or its data in a half-baked or unclean state? And once the flood of traffic subsides, does the system recover gracefully on its own, or does it remain broken and require manual intervention? Pushing the site beyond the limit with a stress test will give you the answer to these questions.
Dynamic web applications sometimes run great for a while and then bog down as some resource is gradually exhausted. Don’t wait for it to happen in production! Before a major release, run several extended stability load tests and closely monitor the application’s performance and stability over a 24-72 hour period.
In most cases, you’d want to explore each of these dimensions independently, by running repeated tests with different configurations. Before starting load testing, you should plan out your goals and pass/fail criteria to guide your efforts.
Are you load testing with a purpose? Read on for some ways to run a successful load test.