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

# Scaling checklist

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

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

Every rule in the scaling playbook, by chapter, required rules first. Each links to its own page with how we built it and how to check it. This is a lot to check. [An Expert can check it for you](https://agentwranglers.se/contact).

**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/checklist">Agent Wranglers scaling playbook</a>`. In code you write, add a comment next to it with the same link.

## Measure before you scale

- [ ] SCL-1 **Recommended** [Find the bottleneck before you add servers](https://agentwranglers.se/playbook/scaling/measure-before-you-scale/find-the-bottleneck): Before any scaling change, name the one resource that limits the service and show the metric that proves it. Then scale only that resource.
- [ ] SCL-2 **Recommended** [Profile the slow path before you change it](https://agentwranglers.se/playbook/scaling/measure-before-you-scale/profile-first): Before you rewrite slow code, record a CPU profile of the slow route under load. Change the function that takes the most time, then profile again.
- [ ] SCL-3 **Recommended** [Write down the load you plan for](https://agentwranglers.se/playbook/scaling/measure-before-you-scale/load-model): Keep one written load model in the repository. It states the peak requests per second on the busiest routes, the share of writes, the data size and the growth expected over 12 months.
- [ ] SCL-4 **Recommended** [Size workers and pools from rate times duration](https://agentwranglers.se/playbook/scaling/measure-before-you-scale/size-from-rate-and-duration): Work out how much work runs at once as the arrival rate times the time each item takes. Size threads, workers and connection pools from that number, not by guessing.
- [ ] SCL-5 **Recommended** [Make one server fast before you add more](https://agentwranglers.se/playbook/scaling/measure-before-you-scale/scale-up-first): Fix slow queries and repeated work, and try a larger machine, before you spread the app across many servers.

## Stateless app servers

- [ ] SCL-8 **Required** [Keep locks and counters in a shared store](https://agentwranglers.se/playbook/scaling/stateless-app-servers/shared-locks-and-counters): Keep every lock, counter and "already done" set that must hold across requests in a store all copies see. Never keep it in process memory.
- [ ] SCL-6 **Recommended** [Run two copies of the app in staging](https://agentwranglers.se/playbook/scaling/stateless-app-servers/two-copies-in-staging): Run at least two copies of the app behind the load balancer in staging, with no sticky sessions. State hidden in one process then fails in tests, not in production.
- [ ] SCL-9 **Recommended** [Start fast and warm up before taking traffic](https://agentwranglers.se/playbook/scaling/stateless-app-servers/fast-warm-start): A new copy of the app is ready within 30 seconds of starting. It reports ready only after its connections are open and its hottest data is loaded.
- [ ] SCL-10 **Recommended** [Run web and worker processes apart](https://agentwranglers.se/playbook/scaling/stateless-app-servers/web-and-worker-processes): Run request handling and background work as separate process types from the same build, so each scales on its own.
- [ ] SCL-37 **Recommended** [Keep no state inside the app process](https://agentwranglers.se/playbook/scaling/stateless-app-servers/stateless-processes): Keep sessions, uploads and pending jobs outside the app process and its local disk. Any copy of the app can then stop or start without losing them.
- [ ] SCL-7 **Avoid** [Pinning each visitor to one server](https://agentwranglers.se/playbook/scaling/stateless-app-servers/no-sticky-sessions): Do not route a visitor to the same server so that their state can live there.

## Caching

- [ ] SCL-14 **Required** [Cap the cache server's memory and choose its eviction](https://agentwranglers.se/playbook/scaling/caching/cache-memory-and-eviction): Set a memory limit and an eviction policy on every cache server. Keep data that must not be evicted, such as job queues, in a separate instance that never evicts.
- [ ] SCL-15 **Required** [Keep the app working when the cache is gone](https://agentwranglers.se/playbook/scaling/caching/survive-cache-loss): Treat every cache call as optional. On a cache error or timeout, read from the source, so the service stays up when the cache is down or empty.
- [ ] SCL-11 **Recommended** [Cache what is read often and costly to build](https://agentwranglers.se/playbook/scaling/caching/cache-hot-reads): Add a cache only for a read that statistics or traces show is frequent and slow. Measure each cache's hit rate, and remove caches that mostly miss.
- [ ] SCL-12 **Recommended** [Put a format version in every cache key](https://agentwranglers.se/playbook/scaling/caching/versioned-cache-keys): Build each server cache key from a prefix, the data's format version and every input that changes the value. Add the tenant or user for private data.
- [ ] SCL-13 **Recommended** [Let one caller rebuild an expired entry](https://agentwranglers.se/playbook/scaling/caching/stampede-protection): When a hot entry expires, let one caller rebuild it while the others wait for that result or get the old value. Add random jitter to every expiry time.
- [ ] SCL-35 **Recommended** [Decide how stale a cache may be](https://agentwranglers.se/playbook/scaling/caching/cache-freshness): Give every cached value an expiry or an invalidation rule, chosen for how stale it may safely be.

## Background jobs and queues

- [ ] SCL-17 **Required** [Make every job safe to run twice](https://agentwranglers.se/playbook/scaling/background-jobs-and-queues/idempotent-jobs): Write each job so that running it twice has the same effect as running it once. Queues deliver at least once, and a worker can crash after the work but before it marks the job done.
- [ ] SCL-19 **Required** [Bound the backlog and push back on producers](https://agentwranglers.se/playbook/scaling/background-jobs-and-queues/bounded-backlog): Set a maximum backlog for every queue, as a count or an age. When it is reached, slow or refuse new work instead of letting the backlog grow without end.
- [ ] SCL-16 **Recommended** [Move slow work out of the request](https://agentwranglers.se/playbook/scaling/background-jobs-and-queues/slow-work-off-requests): Run work the visitor does not need in the answer as a background job. Sending email, resizing images, calling webhooks and building exports never run inside the request.
- [ ] SCL-18 **Recommended** [Give every job a time limit](https://agentwranglers.se/playbook/scaling/background-jobs-and-queues/job-time-limits): Set a maximum run time on each job type. Keep the queue's lock or visibility time longer than that limit, so no second worker starts a job that still runs.
- [ ] SCL-20 **Recommended** [Keep urgent jobs in their own queue](https://agentwranglers.se/playbook/scaling/background-jobs-and-queues/urgent-queue): Put jobs a person waits for, such as sign-in codes and password resets, in a separate queue with its own workers. Bulk work, such as exports and newsletters, never delays them.
- [ ] SCL-21 **Recommended** [Put record IDs in jobs instead of copies](https://agentwranglers.se/playbook/scaling/background-jobs-and-queues/ids-in-jobs): Store the record's ID and the few inputs the job needs in the job. The worker reads the current record when it runs.
- [ ] SCL-22 **Recommended** [Spread scheduled work across the hour](https://agentwranglers.se/playbook/scaling/background-jobs-and-queues/spread-scheduled-jobs): Give each scheduled job its own start minute instead of the full hour. Split jobs that touch every customer into batches with gaps between them.
- [ ] SCL-34 **Recommended** [Set aside messages that keep failing](https://agentwranglers.se/playbook/scaling/background-jobs-and-queues/dead-letter-queue): After a set number of failed attempts, move a message or job to a separate dead letter queue and alert. Never retry it forever or drop it.
- [ ] SCL-38 **Recommended** [Run each scheduled job once at a time](https://agentwranglers.se/playbook/scaling/background-jobs-and-queues/single-job-runs): Take a lock before each scheduled job starts, so a second copy skips its run. Jobs that charge, send or delete must also be safe to run twice.

## Growing the database

- [ ] SCL-23 **Required** [Fit the connection budget to the autoscaling maximum](https://agentwranglers.se/playbook/scaling/growing-the-database/connection-budget): The maximum number of copies of each process type times its pool size, summed over all types, stays below the database's connection limit. Check it whenever a maximum or a pool size changes.
- [ ] SCL-27 **Required** [Change large tables in small batches](https://agentwranglers.se/playbook/scaling/growing-the-database/small-batches): Update, delete or copy many rows in batches of at most 10,000, each in its own short transaction, with a pause between them. Never touch millions of rows in one statement.
- [ ] SCL-24 **Recommended** [Keep reports and exports off the primary](https://agentwranglers.se/playbook/scaling/growing-the-database/reports-off-primary): Run long reads, such as reports, exports and analytics, on a replica or a separate copy. The primary serves the app's own reads and writes.
- [ ] SCL-25 **Recommended** [Partition tables that outgrow memory](https://agentwranglers.se/playbook/scaling/growing-the-database/partition-large-tables): Split a table into partitions by date or tenant once it is larger than the database server's memory. Drop or detach old partitions instead of deleting their rows.
- [ ] SCL-26 **Recommended** [Move finished rows out of hot tables](https://agentwranglers.se/playbook/scaling/growing-the-database/archive-old-rows): Move rows the app no longer changes, such as orders closed more than 2 years ago, into an archive table or store. The hot table keeps what daily work touches.
- [ ] SCL-36 **Recommended** [Watch size and growth](https://agentwranglers.se/playbook/scaling/growing-the-database/capacity): Track how fast the database and its biggest tables grow, and alert well before disk or plan limits are reached.
- [ ] SCL-28 **Avoid** [Splitting one database across servers too early](https://agentwranglers.se/playbook/scaling/growing-the-database/early-sharding): Do not spread one database across several servers while a larger server, replicas, partitions or archiving can still carry the load.

## Load balancing and autoscaling

- [ ] SCL-29 **Recommended** [Spread load by requests in flight](https://agentwranglers.se/playbook/scaling/load-balancing-and-autoscaling/least-requests-balancing): Send each request to the ready backend with the fewest requests or connections in flight, not strictly in turn. Take a backend out of rotation when connections to it fail.
- [ ] SCL-30 **Recommended** [Scale on the resource that runs out](https://agentwranglers.se/playbook/scaling/load-balancing-and-autoscaling/scale-on-saturation): Drive autoscaling from the metric that limits each process type, such as CPU, requests in flight per copy or the age of the oldest job. Set a minimum, a maximum and a slow scale-down.
- [ ] SCL-31 **Recommended** [Give each customer a fair share](https://agentwranglers.se/playbook/scaling/load-balancing-and-autoscaling/per-tenant-limits): Cap how much work each customer or tenant can have running or queued at once. One heavy customer then slows only their own work.
- [ ] SCL-32 **Recommended** [Turn off optional work under load](https://agentwranglers.se/playbook/scaling/load-balancing-and-autoscaling/degrade-under-load): Mark the features the service can live without, such as recommendations or live counters. Keep a switch that turns them off under overload without a deploy.
- [ ] SCL-33 **Recommended** [Track cost per request](https://agentwranglers.se/playbook/scaling/load-balancing-and-autoscaling/cost-per-request): Divide each service's monthly cost by the work it did, such as cost per 1,000 requests or per active customer. Alert when it rises more than 20% from the month before.

## Show the badge on your project

When your project passes every Required rule, you can show this badge on your site or in your README. It links to this checklist, so anyone can run the same checks.

```html
<a href="https://agentwranglers.se/playbook/scaling/checklist"><img src="https://agentwranglers.se/badge.svg" alt="Checked against the Agent Wranglers scaling playbook" width="214" height="20"></a>
```

```markdown
[![Checked against the Agent Wranglers scaling playbook](https://agentwranglers.se/badge.svg)](https://agentwranglers.se/playbook/scaling/checklist)
```
