Load testing an application and network: types, the testing process and reading the results
Load testing shows how an application behaves when many people use it at the same time: how many requests it can handle, how response time grows, where errors appear and what breaks first. It follows a process: goals, scenarios, a load profile, a separate environment with realistic data, a run with monitoring of the server and database, analysis of the results, fixes and a repeat run. You may load only your own systems and only by agreement, and external services are replaced with stubs or test modes for the duration of the test.
Open the software development page
What load testing is
Ordinary testing answers the question of whether a feature works correctly. Load testing answers whether it will keep working when hundreds of people use it at once. A special tool simulates the actions of many users: signing in, searching, placing orders, uploading files. Meanwhile, the team watches how response time, error rate and resource consumption change.
Without such a check, problems surface at the worst moment: on the day an ad campaign starts, during a sale or after a mailing to the whole customer base. Load testing is one type of testing alongside functional, regression and security testing; the full picture is in the guide to software testing.
Types of load tests
| Type | What it checks | When it helps |
|---|---|---|
| Load test | Behaviour at the expected number of users | Before launch and before major releases |
| Stress test | Where the limit is and how the system behaves beyond it | To know the headroom and make sure a failure does not corrupt data |
| Spike test | A sharp jump in load over a short time | Before mailings, ad campaigns and sales |
| Soak test | Behaviour under load over a long period | To find memory leaks and accumulating errors |
| Scalability test | Whether performance grows when resources are added | Before audience growth and when choosing a server setup |
| Volume test | Behaviour with a large amount of data in the database | When the database grows and reports start to slow down |
You do not have to run every type. Usually you start with a load test and a spike test for the main scenarios and add the others when there is a reason.
When load testing is needed
- before launching a product that will immediately receive a noticeable flow of users;
- before an ad campaign, a mailing to the whole base or a seasonal sale;
- after major changes to the architecture or database, or a move to another platform;
- when users complain about slowness at peak hours;
- when the client needs to know how much growth the current system can take.
For a small internal service used by a few dozen employees, full load testing is often excessive; monitoring and a check of the heaviest operations are enough. The decision is based on risk, not habit.
The testing process step by step
A load test is an experiment, and its result is useful only if the conditions are clear and repeatable. The usual order:
- Goals: how many users and operations the system must handle and what response time is acceptable.
- Scenarios: what users do, such as signing in, searching, browsing the catalogue and placing an order, and in what proportions.
- Load profile: how quickly the number of users grows, how long the peak lasts and whether there are sharp spikes.
- Environment: a separate setup similar to production in settings and resources.
- Data: a database volume close to the real one, without real personal data.
- Monitoring: server, database, queue and log monitoring switched on before the start.
- Run: load is applied in steps and the results are recorded.
- Analysis: where response time grew, where errors appeared and which resource ran out first.
- Fixing the bottlenecks and a repeat run under the same conditions.
Repeatability matters most: if the conditions differ each time, you cannot tell whether a fix helped.
What to measure
Average response time says almost nothing, because it hides slow requests. So a set of metrics is used:
- response time by percentile: how fast most requests and the slowest ones are answered;
- error rate and error types: refusals, timeouts, server errors;
- throughput: how many requests and operations the system handles per unit of time;
- CPU, memory, disk and network load on each server;
- database behaviour: slow queries, locks and the number of connections;
- background job queues: whether they grow faster than they are processed.
The outcome of the analysis is not a table of figures but conclusions: up to what load the system still performs acceptably, what limits it beyond that and what must be done to raise the limit. How to speed up the bottlenecks found is covered in the guide to web performance optimization.
Load testing the network and external services
An application depends not only on its own code but also on the network: connections, the load balancer, the content delivery network, and external payment, delivery and notification services. Network load testing checks whether bandwidth is sufficient, how network latency grows under load and whether the load balancer distributes requests correctly between servers.
- load only your own systems, and only with the consent of their owner and the hosting provider;
- replace external services with stubs or their test modes during the test, since they have their own request limits;
- check what the application does when an external service responds slowly or not at all;
- simulate a slow and unstable network for mobile clients, not just office internet.
Overload protection is checked separately: request limits and queues should kick in predictably rather than bring the service down.
Test environment and data
Loading a production server during business hours is a bad idea: the test can slow down real customers. So a separate environment is used, as close to production as possible: the same versions, settings and server layout. If the environment is weaker, the results are interpreted with care and not transferred to production one to one.
Data is prepared in advance. A database with a dozen records behaves nothing like one with years of history, so the volume is brought close to the real one. Customers' personal data is not copied into test environments without anonymisation, and payment scenarios are tested only in the test modes of payment services so that no real money is charged.
Common mistakes
- Testing a single page instead of real scenarios in their real proportions.
- Applying the full load at once rather than in steps, and not seeing where problems began.
- Looking only at average response time.
- Testing on an empty database.
- Not switching on server and database monitoring for the run.
- Loading an external service or a production server without agreement.
- Fixing a bottleneck and not repeating the test under the same conditions.
How JEEKSSHIRE 24 runs load testing
We plan load tests when a product has a real reason for them: a launch with advertising, audience growth, a move or a major architectural change. We agree goals and scenarios with the client, run tests on a separate environment with anonymised data and test modes of external services, and accompany the results with conclusions and a plan of fixes.
Tests, the build and linting pass before deployment, and failure alerts run after launch. If a system already in use needs checking, we start by reading the code and the monitoring. The acceptance procedure is described in the guide to software project acceptance, more on the software support page, and all our services are collected on the software development page.
Frequently asked questions
How is load testing different from stress testing?
Load testing checks behaviour at the expected number of users. A stress test looks for the system's limit and checks how it behaves beyond it and whether data stays intact.
Can a load test be run on a production server?
Only carefully, by agreement and at a quiet time. Usually a separate environment similar to production is used so as not to slow down real customers.
How many users should be simulated?
As many as expected at the peak, with headroom. The figure comes from analytics and advertising and mailing plans, not from guesswork.
What happens to external services during the test?
They are replaced with stubs or test modes. External services have their own limits, and loading them without consent is not allowed.
What is a response time percentile?
It is the value faster than which a given share of requests is answered. Percentiles show how the slowest requests behave, which the average hides.
How often should load testing be done?
Before launch, before expected peaks and after major architectural changes. Between them, monitoring is enough.
What is network load testing?
It is a check of connections, the load balancer and external dependencies under load: whether there is enough bandwidth and how latency grows.
Does a mobile app need load testing?
The main target is its server side, which every installed copy of the app calls. The app itself is additionally tested on a slow network.
What tools are used for load testing?
Specialised tools that simulate requests from many users according to a scenario and record response times and errors. The tool is chosen for the product's protocols and scenarios, and the scenarios are kept with the code so the test can be repeated.