Load testing is a testing process that aims to stress and load an application or system to understand its performance capabilities, determining how it will respond in a number of different scenarios.
Load testing is mostly known for use cases that involve testing a number of users on a website but it actually should include a number of other key parameters depending on what sort of system you are developing.
A few of the aims that testing should be to identify are
- The maximum number of users/devices an application can serve
- Autoscaling capabilities
- The appropriate sizing of fixed infrastructure (too large and too small)
- Response times
- SLA conformity
- and many more
High level load testing strategies
You have 4 main options when it comes to load testing.
- The first we will skim over is manual testing, this is only really appropriate in load testing when the number of entities that would cause the system to run at full load is very small.
- Open-source load testing tools, the open-source community is a great place to start when it comes to free to use tooling that can often be built to the standard acceptable for enterprise companies. These tools may not have the same ease of use wrapper around them and often you will have to host them on your own infrastructure (don’t forget that has a cost) but will cost you significantly less in time and effort than the next two.
- Paid Solutions, now often teams don’t want to have to host and manage the tools this is where other companies can come in and provide you a service.
- Self-made solutions, inhouse developed tools can give you the exact required toolset but this comes at a lot of developer expense. It is however often the only solution for very specific testing needs.
How to start load testing
Identify critical paths first, it is important that you know what you want to test first so you can work out what things could stress that system.
- Identify all of the endpoints that could impact the application including UI, Backend and any real-time endpoints.
- Categorize these into types of system, end user, system, device.
- Prioritize the severity of each path, you won’t get round to automating everything on day 1, make sure the critical systems work first.
Gather a baseline, you need to understand what system load will look like in a number of scenarios this will include things like normal load, max load and event specific spikes.
- Create a target benchmark for each of your scenarios
- Calculate the average rate of requests during peak hours or record it if you have
- If you are struggling to build the scenarios then a quick and easy idea is to double the expected load and monitor over time.
Create a test environment, this needs to be a safe space that will not impact any other used systems (Prod and development)
- Create a tool that will spin up a workspace
- The environment should have a number of loading modes (double, expected, low are a good starting point) don’t forget it’s important to check the system with low-no load to make sure the system will react and you won’t be wasting money on infrastructure that is not needed (especially in cloud environments)
- Tests should be simulating valid data (recorded playback if possible)
Load or stress test?
It is important that you understand the uses of load and stress testing.
- Load testing should be used to help in identifying bottlenecks or costing issues within the system by varying the load gradually and looking at how the system responds.
- Stress testing is more about revealing the points at which a system will collapse, capturing the services or functions that get overwhelmed or stop altogether.
Categories: Developer Chat