Performance Testing: How to Check Speed Before Users Do
Performance testing checks how fast software responds under real load. Learn the test types, the metrics that matter, and how to run a first test.
On this page
Short answer
Performance testing is the practice of measuring how software behaves under load: how fast it responds, how much traffic it can handle, and where it starts to fail. Teams run it before launch and before big events so that slow pages, timed-out checkouts and crashed servers are found in testing, not by users.
What is performance testing?
Performance testing is the practice of putting software under a planned load and measuring what happens. A team sends a known number of users, requests or transactions at the system and records response times, error rates and resource use. The goal is not to prove the system is fast but to find the point where it slows down or breaks, and to fix that point before users reach it.
It differs from functional testing, which checks whether a feature works at all. A checkout can pass every functional test and still fail in production if it takes thirty seconds when five hundred people check out at once. Performance testing answers a different question: does it still work when many people use it at the same time?
| Test type | What it checks | Example |
|---|---|---|
| Load | Behaviour at expected traffic | 500 users shopping at once |
| Stress | Behaviour past the limit | 2,000 users when the site expects 500 |
| Spike | Sudden traffic jumps | A sale announcement doubling traffic in a minute |
| Endurance | Behaviour over a long run | Normal traffic for 12 hours straight |
| Scalability | What more capacity buys | Doubling servers and measuring the gain |
Most teams run load tests often and stress tests before big events. Endurance tests catch slow leaks, such as memory that grows a little with every request until the server runs out hours later.
Which metrics matter in performance testing?
The metric most teams watch first is response time: how long a request takes from the click to the answer. Averages hide problems, so teams also watch the slowest requests, usually the 95th percentile, which shows what the slowest five percent of users experience. If the average is fast but the slowest five percent wait ten seconds, those users still leave.
Throughput is the second metric: how many requests, checkouts or searches the system finishes each minute. Error rate is the third: what share of requests fail, time out or return an error. A system can look fast while failing one request in ten, which is worse than being slow.
Resource use sits behind those three. CPU, memory, database connections and disk speed show where the bottleneck is. When response time climbs and the database is at full use while the web servers are idle, the fix is in the database, not in adding web servers. Good tests record all four together so the team can see the cause, not just the symptom.
How do you plan a performance test?
A performance test starts with a realistic picture of real use. The team looks at which pages people visit, which actions they take, and how many do it at the busiest time. A test that sends a thousand users to the home page proves little if real users spend their time on search and checkout.
- Pick the busiest flows. Choose the three or four actions that matter most, such as search, add to cart and checkout.
- Set the load. Use real traffic numbers for the expected load and a higher number for the stress case.
- Set the pass bar. Write down the response time and error rate that count as a pass before running the test.
- Use a test environment like production. A small test server gives small numbers that do not predict production.
- Run, fix, repeat. Fix the worst bottleneck, then run the test again to see if the fix worked.
Teams also test with realistic data. A database with ten test products behaves nothing like one with ten thousand, so the test data should match the size and shape of the real data. For how teams plan a first release test, see how to validate an app idea.
Example (hypothetical): a shop tests its checkout
Example (hypothetical): a shop expects 10,000 checkouts an hour during a sale. Each checkout takes a shopper about 2 minutes from cart to payment, so one shopper completes 30 checkouts an hour. To reach 10,000 checkouts an hour, the shop needs 10,000 / 30 = 334 shoppers checking out at the same time, so the team rounds up and tests with 500 concurrent shoppers.
The first test shows the payment step taking 8 seconds at 500 shoppers, while the pass bar is 3 seconds. The database is at full use, so the team adds an index on the order table and caches the delivery options. The second test shows the payment step at 2 seconds with no errors.
The team then runs a stress test with 1,000 concurrent shoppers. The payment step rises to 5 seconds and 2 in 100 checkouts fail, which tells the team the limit is around 800 shoppers. They set the sale to open in waves rather than all at once, and the launch runs without a crash.
Which tools do teams use for performance testing?
Teams use load-testing tools to send the traffic and dashboards to watch the result. Well-known open-source tools include JMeter, k6 and Locust, which let a team write a test script that acts like a user: visiting pages, searching, adding items and checking out. The tool then runs that script with hundreds or thousands of virtual users at once.
Cloud load services do the same job without the team running its own load machines, which matters when the test needs more traffic than one office connection can send. Either way, the tool is the easy part: the hard part is writing a test that acts like real users, with realistic pauses, realistic data and realistic mixes of actions.
Teams also watch the system while the test runs, using the same monitoring they use in production. A test without monitoring shows that something is slow but not why, so the team pairs the load tool with server and database metrics. For how releases are automated around these checks, see what CI/CD is.
What are the common mistakes?
The most common mistake is testing with too little load. A test with fifty users tells a team nothing about a launch that brings five hundred, so the load should match the busiest real hour, with a stress case above it. Testing only the home page is the same mistake in another form: the busiest flows are the ones that break.
Another mistake is testing on a small server and assuming production will be faster. It usually is faster, but the team cannot say by how much, so the results mislead. Test on an environment as close to production as the team can afford.
Teams also run the test once and move on. Performance drifts as features are added, so the load test belongs in the release routine, not in a one-off project. And do not chase the average response time alone: watch the slowest requests and the error rate, because those are what users actually feel.
Key takeaways
- Performance testing measures speed and limits under planned load.
- Watch the slowest requests and the error rate, not just the average.
- Test the busiest real flows with realistic data and load.
- Run the test on an environment close to production.
- Fix the worst bottleneck, then test again.
Frequently asked questions
What is the difference between load testing and stress testing?
Load testing checks behaviour at the traffic a team expects, while stress testing pushes past that limit to find where the system breaks. Load tests run often and should pass; stress tests are run before big events to find the ceiling and plan around it.
How many users should a performance test use?
As many as the busiest real hour brings, plus a margin. A team looks at real traffic for the busiest flows, works out how many users are active at once, and tests at that number and above. A test with far fewer users than reality proves little.
What is a good response time?
It depends on the action, but most teams set a bar before testing, such as under 2 seconds for a page and under 3 seconds for a checkout step. The 95th percentile matters more than the average, because it shows what the slowest five percent of users experience.
Can performance testing be automated?
Yes, and it should be. Teams run a load test as part of their release routine, with the same scripts each time, so a new feature that slows the system down is caught before it reaches users. The test is checked in with the code it tests.
Does performance testing find bugs?
It finds a specific kind: slow queries, missing indexes, memory leaks and capacity limits that only appear under load. It does not find wrong calculations or broken features, which is what functional testing is for. The two kinds of testing cover different risks.
When should a team start performance testing?
Before launch, and again before any big event such as a sale or a campaign. Starting early is cheaper, because fixing a slow database query in testing costs far less than fixing it while users are timing out.