---
title: "Scaling playbook · Agent Wranglers"
url: https://agentwranglers.se/playbook/scaling
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Scaling playbook

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Playbook](https://agentwranglers.se/playbook.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

A scaling playbook for apps that start to get busy. It starts with measuring, to find the bottleneck and write down the load you plan for. Then it covers stateless app servers, caching, background jobs and queues, and growing the database. It ends with load balancing, autoscaling, fair shares per customer and cost per request. Most apps never need half of it, so measure first and scale the part that is slow.

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/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">Agent Wranglers scaling playbook</a>`. In code you write, add a comment next to it with the same link.

## Chapters

1. [Measure before you scale](https://agentwranglers.se/playbook/scaling/measure-before-you-scale): Find the resource that runs out first from metrics and profiles. Write down the load you plan for before you add servers or caches.
2. [Stateless app servers](https://agentwranglers.se/playbook/scaling/stateless-app-servers): Any copy of the app can serve any request, start fast and stop without losing work. Then you can add or remove copies at any time.
3. [Caching](https://agentwranglers.se/playbook/scaling/caching): Cache only what is read often and costly to build. Key it fully, let one caller rebuild an entry, and keep the app up when the cache is gone.
4. [Background jobs and queues](https://agentwranglers.se/playbook/scaling/background-jobs-and-queues): Move slow work out of requests into queues. Make every job safe to run twice, bound the backlog, and keep urgent work ahead of bulk work.
5. [Growing the database](https://agentwranglers.se/playbook/scaling/growing-the-database): Budget connections across every copy, keep reports off the primary, partition and archive big tables, and change large tables in small batches.
6. [Load balancing and autoscaling](https://agentwranglers.se/playbook/scaling/load-balancing-and-autoscaling): Send traffic only to ready servers and spread it by load. Scale on the resource that runs out, cap each customer's share and watch cost per request.

See all 38 rules on one page in the [checklist](https://agentwranglers.se/playbook/scaling/checklist). This is a lot to check. [An Expert can check it for you](https://agentwranglers.se/contact).

## Related playbooks

- [Capacity and cost](https://agentwranglers.se/playbook/operations/capacity-and-cost) in the Operations playbook. Watch saturation and spend in production, and add capacity before a limit is reached.
- [Non-functional tests](https://agentwranglers.se/playbook/testing/non-functional-tests) in the Testing playbook. Prove a change scales with a load test before users find the limit.
- [Queries and indexes](https://agentwranglers.se/playbook/data/queries-and-indexes) in the Data playbook. Most slow apps are slow queries. Fix the query plan before adding servers.
- [Performance](https://agentwranglers.se/playbook/website/performance) in the Website playbook. Fast pages and HTTP caching take load off the servers before it reaches them.
