A replica holding 20 concurrent tool calls, each waiting 25 seconds on a downstream API, shows 5–6% CPU utilization. The autoscaler sees a healthy pod and holds the replica count at the minimum. The 21st caller queues. The failure also runs in reverse: when a burst of queued calls all return at once, CPU spikes after the damage is done, and the autoscaler scales up for load that has already passed.
The signal that tracks agent load is concurrency — how many calls a replica is holding right now. This article replaces the CPU-based HPA from the earlier deployment article with KEDA scaling on in-flight concurrency, adds drain-aware scale-down so busy pods are the last to go, and pre-provisions spare capacity so a burst never waits on a node.
Instrument the signal first
Nothing can scale on concurrency until the server reports it.…