Guide

Operating at scale

Backpressure

A server that takes in every request gets slow for everyone once traffic passes the knee. Backpressure caps how much work gets in. A short queue holds a little extra, and the rest get a quick "busy, try later" reply (HTTP 429). The requests already inside still meet the SLO, so goodput stays high.

Autoscaling

Autoscaling adds copies of the model server, called replicas, when queues grow, and removes them when it is quiet. A new GPU replica is slow to start: the machine boots, then many GB of weights load into the GPU. So scale early, on queue depth rather than CPU use, and start replicas ahead of known peaks.

Routing

A router picks a replica for each request. Round robin takes turns, and least busy picks the shortest queue. Prefix-aware routing sends a request to the replica that already holds its prefix in cache, so it skips most of the prefill. It must still spread the load, so one hot replica doesn't get a long queue.

Multi-LoRA

LoRA tunes a model for a new task with a small adapter: a few extra weights on top of the base model. Multi-LoRA serving keeps one base model in memory plus many adapters. Each request names its adapter, and different adapters can share a batch. An adapter only works with the base model it was trained on.

What to watch

Watch queue depth, running requests, KV cache use, tokens per second, TTFT and ITL percentiles, and errors. A full cache plus a growing queue means the replica is full. GPU use of 100% only says the GPU was busy, not that it did as much useful work as it could.

Remember

  • Turn extra work away early; don't let everyone get slow.
  • GPU replicas take minutes to start, so scale early.
  • Route repeated prefixes to the replica that has them cached.
  • Many tuned versions can share one base model.
  • Judge health by queue, cache and latency percentiles.