1:1 mentoring with Big Tech AI engineers
System Design

Scaling the Agent Runtime

Autoscale on runs in flight, size slots with Little's law on the measured mean, keep connections out of model calls, and find the provider's walls.

Last updated

Production10 min readFirst readScaling 10k to 1MDeploy Your First Agent

After this section you can

  • Choose runs in flight as the autoscaling signal, and say why CPU misleads
  • Size slots and the database pool with Little's law and a tail count
  • Name which provider wall binds first, and what each lever does to it
36

Scaling the Agent Runtime

Why CPU misleads an autoscaler, how many slots a pod needs, and which provider limit binds first.

Key idea

An agent pod is full when its slots are full, even at low CPU. Scale on runs in flight, size slots with Little's law on the measured mean, and never hold a connection across a model call. Pods are elastic; the provider's token meter and spend cap are not.

A full pod can run at 8 percent CPU
18 s runs20 of 20 slots takenCPU 8%36 s runs20 of 20 slots takenCPU 4%

Teal: the run slots, the thing to scale on. Grey: CPU, which adds no pod. Pans sideways on a phone.

Related

More in System Design

Get full access to all 149 sections with code examples, diagrams, and interactive animations.

Unlock Premium