Ordering slows to a crawl when everyone orders at once
Fine for one employee. Too slow when a whole company orders at the start of the month.
- Employee
Why ordinary tests miss it
Every test calls the order endpoint once. A slow query or a missing index only shows with many requests in flight, and that happens on the busiest day.
Set it up
An employee logs in. The employee sees the products and orders a product. The employee sees their orders.
Describe the journey in one sentence. The flow signs the employee in, lists the products and orders one.
Open “Load test” in the top bar and pick the order step. The steps before it run once, to sign in and pick a product.
Choose the number of requests and how many run at once, and set your limits for the error rate and the p95 response time.
Run it on a live environment whose domain you verified. The console shows throughput and p95 while it runs.
The moment it’s caught
-
✓
Errors
POST /api/orders0.4%, limit 1% -
✗
p95
POST /api/orders2,840 ms, limit 800 ms -
✓
Afterwards
GET /api/ordersCount checked: all 1,000 orders are there
You see it on a test environment, with the step that is slow, before the first of the month does it for you.
What you use
Next case: Nobody can log in after the login page got a new look
Catch this one in your own product
Connect a repository, describe the journey, and run it against the mock in a few minutes.