The campaign email went out, dealers logged in to the portal at the same moment, and the order screen stopped responding. Every functional test had passed; the system worked flawlessly for a single user. What nobody had tried was how it behaves under a crowd. Performance testing does exactly that: it runs the software under realistic and extreme load and measures its speed, error rate and resource use.
In this guide we cover the test types, how to calculate the target as concurrent users and requests per second, how to read response times through percentiles (p95, p99), how to build a realistic scenario and test data, how to get from a result to the bottleneck, acceptance criteria, wiring the test into a CI pipeline, and a six-step plan. The dealer portal example and all figures are illustrative; they are not measurements of a specific system or industry averages.
What Is Performance Testing and How Does It Differ From Functional Testing?
Performance testing measures how fast, stable and scalable software is under a given load. Functional testing asks "does it return the right result?"; performance testing asks "how many people does it serve that result to, how quickly, and without errors?"
We covered how to build functional tests in our software testing guide and the automation decision in our test automation article. This one deals only with the performance dimension. How a system absorbs growing load (vertical and horizontal scaling, Little's law) is the subject of our scalability guide; this article shows how to test that knowledge.
We recommend reading: What is software scalability?
What Are the Types of Performance Tests?
There are four basic types, and each answers a different question. Which one you run depends on the risk your system carries.
| Type | Question | Example scenario (illustrative) | Output |
|---|---|---|---|
| Load test | Does it carry the expected peak? | 90 req/s, steady for 30 min | p95, p99, error rate |
| Stress test | Where and how does it break? | Steps of 90 → 135 → 180 → 225 req/s | Breaking point, failure mode |
| Soak test | Does it degrade over time? | 40 req/s for 8 hours | Memory and connection curve |
| Spike test | Does it recover from a sudden surge? | 20 → 200 req/s within 10 s | Recovery time, lost requests |
The minimum package is a load test and a stress test. Businesses with surges (campaigns, month-end, seasons) add a spike test; systems that run uninterrupted for long periods add a soak test.
How Do You Set the Target? From Concurrent Users to Requests per Second
The target is derived from requests per second, not from a user count, because what loads a server is the request, not the person. For the conversion we use Little's law: concurrent users = request rate × (response time + think time). The law itself is explained in the scalability article; here we only apply it.
In the dealer portal example, 1,800 sessions start in the busy hour and each session makes 40 requests.
- Average request rate: 1,800 × 40 ÷ 3,600 s = 20 req/s.
- Peak minute: Load is never evenly spread; let the campaign moment be 3 times the average: 20 × 3 = 60 req/s.
- Target: A 50% margin for growth and uncertainty: 60 × 1.5 = 90 req/s.
- Concurrent users: With a 0.4 s response time and 14.6 s think time, each user cycle is 15 s; 90 × 15 = 1,350 concurrent users.
Check: on an average day, 20 req/s × 15 s = 300 concurrent users; at peak that is 3 times, 900; with the margin it is 1,350. Do not guess the peak multiplier; read the busiest minute from access logs or monitoring data.
How Do You Read Response Time? Average, p95 and p99
The average response time misleads, because a few very slow requests disappear inside it. Percentiles answer "what share of requests is faster than this?": p95 is the time below which 95% of requests fall.
Example: of 100 requests, 90 took 300 ms, 6 took 800 ms, 3 took 2,500 ms and 1 took 6,000 ms.
| Measure | Value | Meaning |
|---|---|---|
| Average | (27,000 + 4,800 + 7,500 + 6,000) ÷ 100 = 453 ms | Looks like there is no problem |
| p50 (median) | 300 ms | The typical user experience |
| p95 | 800 ms | 1 user in 20 sees something slower |
| p99 | 2,500 ms | The real size of the slow tail |
If an order screen makes 5 separate requests when it opens, the chance that a user meets a p95-slow request is 1 − 0.95⁵ ≈ 22.6%; percentiles are felt as worse at page level than they look. A reliable p99 needs enough samples: a 30-minute run at 90 req/s produces 162,000 requests, and p99 is then the threshold of the slowest 1,620 requests.
How Do You Build a Realistic Scenario, Think Time and Test Data?
The scenario imitates a real user's journey; test data is the records that journey runs on. If either is unrealistic, the result will be better or worse than production.
- User mix: Take transaction ratios from access logs, for example 60% product search, 25% order creation, 10% order lookup, 5% reports.
- Think time: Real users wait between requests. With zero think time, 1,350 virtual users generate 1,350 ÷ 0.4 = 3,375 req/s, 37.5 times the target. Take think time from a measured distribution (such as a 14.6 s average).
- Data variety: If 1,350 users log in with the same 50 accounts, the cache works unrealistically well. At 450 queries/s, a 2% cache miss rate sends 9 queries/s to the database, while a realistic 30% sends 135 queries/s: a 15-fold difference. Vary accounts, products and orders enough.
- Data volume: If the test database holds 20,000 orders and production holds 2,400,000, that is a 120-fold gap, and query times can jump from a few milliseconds to hundreds. Bring the volume close to production.
- Personal data: Do not copy production data into the test environment unmasked; for KVKK (Turkey's personal data protection law) obligations, consult your legal counsel.
The load is applied not as a barrage on one endpoint but with this mix and a long warm-up: virtual users ramp up over 5 minutes (1,350 ÷ 300 s = 4.5 users per second), and the first 3 minutes are excluded from measurement because the cache and connection pool are cold.
How Similar Must the Test Environment Be to Production?
It does not have to be identical, but the similarity determines how you interpret the result. Predicting a large environment from a small one is often wrong, because bottlenecks do not scale linearly.
| Dimension | Should match production | Risk if different |
|---|---|---|
| Server specs and count | Ideally the same; otherwise state the ratio | Measuring at half capacity and doubling is wrong |
| Data volume and distribution | Same order of magnitude | Queries fast in test, slow in production |
| Network and connected systems | Similar latency | A stubbed external system looks far too fast |
| Configuration | Connection pool, cache, log level | Results skew when debug logging is on |
| Load generator | A separate machine from the target | The generator becomes the bottleneck and the system gets blamed |
If you stub external systems (payment, shipping, ERP), give the stub a realistic delay; putting real services under load requires the other party's permission. For integration points, see our API integration guide.
How Do You Read the Result and Find the Bottleneck?
You read the result by raising the load step by step and watching where response time and errors degrade. In the example, the acceptance criteria are p95 ≤ 1,200 ms and errors ≤ 1%.
| Load (req/s) | p95 (ms) | Errors | Criteria |
|---|---|---|---|
| 60 | 420 | 0.0% | Passed |
| 90 (target) | 700 | 0.1% | Passed |
| 135 | 1,100 | 0.4% | Passed (borderline) |
| 180 | 2,900 | 3.2% | Failed: breaking point |
At the 90 req/s target the system is comfortable; the criteria hold up to 135 and break at 180. The capacity margin is 135 ÷ 90 = 1.5× (against the expected peak, 135 ÷ 60 = 2.25×). To find the bottleneck, look at resource metrics: CPU, memory, disk, network, database connections and queue length. The first resource to saturate as the curve bends is the bottleneck.
In the example, the database connection pool has 40 connections, the average query takes 0.05 s, and each request runs 5 queries. The pool can sustain 40 ÷ 0.05 = 800 queries/s; 800 ÷ 5 = 160 req/s. Load above this ceiling queues: 180 − 160 = 20 req/s excess, 1,200 requests pile up in 60 seconds, and response times shoot up. That the break starts between 135 and 180, just above the pool ceiling, confirms it.
- One change at a time: Fix only one thing per round (raise the pool to 60, add an index to one query) and re-run the same test.
- The next bottleneck: With the larger pool the ceiling becomes 60 ÷ 0.05 ÷ 5 = 240 req/s; the next limit may be CPU or an external service. A bottleneck never disappears, it only moves.
What Do Soak and Spike Tests Reveal?
Two classes of problems stay invisible in a short load test: damage that accumulates over time and the reaction to a sudden surge.
In a soak test, a moderate load such as 40 req/s runs for 8 hours. If memory climbs from 1.2 GB to 3.6 GB, the growth is (3.6 − 1.2) ÷ 8 = 0.3 GB per hour. If the process limit is 6 GB, the crash comes at (6 − 1.2) ÷ 0.3 = hour 16; so even if everything looks green when the test ends, the system must be restarted before a full day is out. A short test never catches such leaks.
In a spike test, a campaign email is simulated: 20 req/s jumps to 200 req/s within 10 seconds. With a pool ceiling of 160, 40 req/s of excess arrives; if autoscaling takes 120 seconds to bring new capacity online, 40 × 120 = 4,800 requests are delayed or fail in that window. The options are clear: add capacity beforehand, smooth the load with a queue, or split the campaign into slices.
How Do You Write Acceptance Criteria?
Criteria are written before the test starts and are numeric. Otherwise the criteria get bent to fit the result once you see it.
| Measure | Criterion (illustrative) | Example result (90 req/s) |
|---|---|---|
| p95 response time | ≤ 1,200 ms | 700 ms: passed |
| p99 response time | ≤ 3,000 ms | 1,600 ms: passed |
| Error rate | ≤ 1% | 0.1% (162 of 162,000): passed |
| CPU use (steady window) | ≤ 70% | 58%: passed |
| Memory trend | Not rising in the steady window | Flat: passed |
| Capacity margin | ≥ 1.5× the target | 135 ÷ 90 = 1.5: borderline pass |
Choose the criteria together with the business: 1.2 s p95 may be fine on an order screen, while the payment step may need a tighter target. If this table becomes part of the delivery acceptance criteria, there is no argument at the acceptance stage; our user acceptance testing guide shows how criteria tie into the acceptance rule.
How Do You Connect Performance Testing to a CI Pipeline?
Performance degrades slowly, release by release, and the way to catch it is to put the test in the pipeline. But running a 30-minute load test on every change is impractical, so it is built in two layers.
- A short smoke test on every merge: 2 minutes, 20 req/s, three critical flows. With 50 merges a week that is 50 × 2 = 100 minutes of pipeline time. The aim is to catch regressions, not absolute capacity.
- A full run overnight or on weekends: 30 minutes of steady load, the full scenario, results compared with history.
- Regression threshold: If the baseline p95 is 700 ms, a 20% margin gives a threshold of 700 × 1.2 = 840 ms. If the new version shows 910 ms (+30%), the merge stops.
- Noise margin: A single run fluctuates; take the median of 5 repeats.
For the pipeline setup and deployment stages, see our CI/CD guide. Comparing test results with real behavior in production is the job of the monitoring layer.
A Six-Step Performance Testing Plan
The plan below fits into roughly ten working days for a small system; the sequence can be adapted to a real project calendar.
- Write the target (1 day): Requests per second, peak multiplier, concurrent users and acceptance criteria from access logs.
- Build the scenario (3 days): Transaction mix, think time, varied test data and a warm-up plan.
- Prepare the environment (2 days): Production-like size and data volume, a separate load generator, a monitoring dashboard.
- Make the first run (1 day): The load test, then stress steps; record the results.
- Analyze and fix (2 days): Find the bottleneck, make one change, run again.
- Wire it into the pipeline (1 day): Smoke test, nightly run and regression threshold.
The total is 1 + 3 + 2 + 1 + 2 + 1 = 10 working days. At ₺9,000 per person-day the cost is ₺90,000. If a 3-hour outage on a campaign day costs ₺60,000 an hour, it comes to 3 × ₺60,000 = ₺180,000; the test costs half of that (90,000 ÷ 180,000 = 0.5). The figures are illustrative; recalculate with your own revenue and team rates.
We recommend reading: What is software monitoring?
We recommend reading: How to Do Incident Management and Post-Mortems: SEV Levels, On-Call, MTTR and Blameless Review Guide
We recommend reading: What Is a Message Queue and Asynchronous Processing? Producers, Consumers, Retries and Capacity Guide
We recommend reading: How to Improve Database Indexing and Query Performance: An Index, N+1 and Slow Query Guide
We recommend reading: What Is Batch Processing and Scheduled Jobs? Batch Windows, Restarts, Locks and the Critical Path
We recommend reading: What Is Caching? Layers, TTL, Invalidation, Cache Stampede and Payback Guide
We recommend reading: How to Prevent Double Selling with Concurrency Control: Locking, Optimistic Versioning and Reservations
We recommend reading: How to Improve Website Speed: Page Weight Budget, Images, Scripts and Core Web Vitals Guide
We recommend reading: How to Prepare an E-Commerce Store for Peak Campaign Season: Demand, Stock, Capacity and Live Control Guide
We recommend reading: How to Measure and Improve Mobile App Performance and Crash Rate: Indicators, Crash Analysis and Performance Budget Guide
Performance-Focused Custom Software Development with İnovabil
At İnovabil our focus is building company-specific software from scratch. Testing is a recorded step in our process; we suggest writing load expectations (user counts, campaign surges, ERP and marketplace integration volume) down at the requirements stage, because performance cannot be tested without a target. We do not present this as a performance guarantee or a commitment to a separate testing service; it is a recommendation and a way of working.
We built CRM, purchasing and mobile for Avcılar İnşaat; a purchasing system for İZBAN; logistics and shipment planning with wholesale order management for Karyak; and warehouse management plus a complaint and support management system for Sleepy. Share a short summary of your system's expected load, and let us put the target in writing together.
We recommend reading: Our software development process: from analysis to release
Frequently Asked Questions
What is performance testing and when is it done?
It is a test that measures software speed, error rate and resource use under a given load. It is done before a major release, before a campaign or growth period, and after significant architectural changes; ideally it runs regularly in the CI pipeline.
What is the difference between load testing and stress testing?
A load test checks whether the system carries the expected peak. A stress test raises the load until the criteria break to find where and how the system fails; the result is the breaking point and the capacity margin.
How many concurrent users should I test with?
Instead of guessing a user count, calculate the requests-per-second target: sessions × requests per session ÷ time, then the peak multiplier and margin. In the example, 20 req/s average, 60 at peak and 90 as the target correspond to 1,350 concurrent users with a 15 s cycle.
Why is average response time not enough?
A few very slow requests disappear in the average. In the example the average looks like 453 ms while p99 is 2,500 ms. p95 and p99 show the real size of the slow tail.
Can I trust results from a small test environment?
Only with care. Because bottlenecks do not scale linearly, measuring at half capacity and doubling misleads. Bring data volume and configuration close to production, write the differences into the report and read the result as a lower bound.