SCL-1Recommended
Find the bottleneck before you add servers
Before any scaling change, name the one resource that limits the service and show the metric that proves it. Then scale only that resource.
How to do it
Raise load in steps with a load test. Where response times start to climb, read how busy each resource is and how much work waits, as Measure what each machine uses records. The bottleneck is the first one to saturate, such as CPU near 100%, a pool with requests waiting or a slow disk. More app servers in front of a saturated database only add load to it. Fix the bottleneck and test again, because the next one then shows. The Google SRE book advises measuring capacity in available resources, not only in requests per second.
How to check
Every scaling change in the last 12 months has a note that names the saturated resource. The note shows that resource's metric before and after the change.
Sources
Related rules
- Test load against a budget in Testing
- Measure what each machine uses in Operations
- Splitting one database across servers too early in Scaling
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/scaling/measure-before-you-scale/find-the-bottleneck">Agent Wranglers scaling playbook</a>. In code you write, add a comment next to it with the same link.