SCL-5Recommended
Make one server fast before you add more
Fix slow queries and repeated work, and try a larger machine, before you spread the app across many servers.
How to do it
One machine has no network between its parts, no shared cache to keep in step and no locks across servers. Many servers add all three. First work through Load related rows in one query and Index the queries you run. Move to more servers when the largest machine you can buy is not enough. Also move when the service must survive the loss of a machine, as Run production in two zones or more asks.
How to check
Each move to more app or database servers has a decision note. It links a load test where the largest planned machine passed 70% CPU or broke its 95th percentile objective at the planned peak. Otherwise it names the availability target that needs a second machine.
Related rules
- DAT-11 Load related rows in one query in Data and databases
- DAT-9 Index the queries you run in Data and databases
- OPS-78 Run production in two zones or more in Operations and observability
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/scale-up-first">Agent Wranglers scaling playbook</a>. In code you write, add a comment next to it with the same link.