In the past, performing a load test was the responsibility of a dedicated team within the organization (or a team of expensive external consultants). They had access to extravagant licenses for a suite of complex load-testing tools. With the adoption of open-source testing tools, combined with the outbreak in cloud computing, this is no longer the case in modern software development.
User Journey – The fundamentals of load test
Perhaps the most fundamental criteria for success in load testing is crafting accurate user journey scenarios through the system. This is critical to understand before deciding on any other load-testing efforts.
In order to create the best user journey, you must gather all available data from every available resource in the business to determine, as accurately as possible, how users interact with the system. Only then can you define a realistic test scenario.
Questions to ask might include:
- Where does our traffic originate from geographically?
- How many users are there concurrently at different times of the day?
- Which functionality or feature of the system is the most popular (or most critical)?
- What is an acceptable amount of time that users will be prepared to wait for a response from the system?
- With which type of model do users arrive into the system: open or closed?
Finally, understanding which type of model can be applied to the traffic flows through the system is crucial to produce an accurate load test scenario. Using an incorrect model is akin to comparing apples with oranges and will render most load testing results useless.
Open model versus Closed model
Let’s consider the differences between an open model and a closed model:
- Open model
All users will indiscriminately access the system. Users arrive in a continuous manner and the system has no control over this. The majority of systems and websites follow this model.
- Closed model
The system is designed to control and limit the number of users that can access it. Typically, the user will have to virtually “queue” to enter the system at busy periods. You can find easy examples of this model in some gaming or ticketing websites.
A common mistake in load testing is using an incorrect model or incorrectly predicting the rate at which users will arrive at the system and the actions that they will perform once they do. You can address these issues by identifying as much data from multiple resources as possible from across the business. That way your scenario’s data will be as accurate as possible.
Gathering this data, and converting it into non-functional requirements, will enable you to construct a realistic load test for your system.
Tools to perform a load test
You need three different types of tooling to execute a load test:
- Provisioning tools
These tools allow you to construct and deploy your application predictably and repeatedly. As one bottleneck is identified and fixed in the system from your load-testing efforts, another will typically occur at a later point further down the line. It is therefore critical to be able to keep building, deploying and running tests against the system quickly and effectively. Tools such as Docker and Kubernetes have greatly simplified this process.
- Monitoring tools
In order to measure system performance and identify bottlenecks that need to be fixed, you need monitoring tools. Open-source options such as Prometheus are readily available, as well as a host of commercial enterprise solutions.
- Load-injection tools
These are the tools used to artificially generate web traffic that will be sent to the system under test. As with monitoring, a host of open-source and commercial tools exist in the market.
The basis of your load-testing efforts will be to acquire and use tools from all three types. In addition to the tools, you will also need to engage trained and skilled engineers comfortable with them. You may find engineers that are specialized in a particular type of tool from the above categories, but it is also possible to find specialist performance engineers that are skilled across the whole range.
A final word
The number and skill level of the engineers you assemble for your load testing efforts will naturally depend on the nature, criticality and resources of your project. If you are developing a mission-critical application, or one that is expected to handle huge numbers of highly valuable transactions, you should invest in your performance testing team and tooling appropriately.
Learn more about Gatling and exchange with our team and other users on our Community platform.
The Gatling team