All glossary terms

Serving

Load balancing

Spreading requests across replicas so no card queues while another idles - and choosing what to balance for, because perfect balance can destroy cache locality.

The plain job is arithmetic: arrivals divided across the fleet so utilization is even. Round-robin or least-loaded achieves that and is the right answer when every request is alike. It is the wrong answer the moment a prefix cache exists, because round-robin spreads one repeated prompt family across every card and forces each card to keep its own copy of the preamble or pay the prefill again.

Cache-aware routing balances something subtler: the hash of a request family sends its requests to one card, so the card keeps the preamble resident and the fleet converts capacity into cache hits. The cost is concentration - one hot family lands on one card while others idle - so real designs pair the hash with a fallback: overflow to the next choice when the sticky card queues, shard the hottest families across two cards, or cap the queue-depth difference the hash may create.

The interview version of the question is not "which balancer" but "which knob, observed by which meter": balance is judged by queue depth and utilization, locality is judged by the cache hit share, and a design that can name both numbers - and what it sacrifices between them - is the answer that survives follow-up questions.

A worked example

A 64-card fleet serves one request family that owns 80 percent of all arrivals, and each card can keep its prefix cache copies for at most a few families. Compare round-robin with hash routing on that family.

  1. Round-robin: every card sees an equal 100/64 = about 1.56 percent of the family, so no card sees enough of it to justify a resident preamble, and hits are rare in practice.
  2. Hash routing: the busiest card takes 80 + 20/63 = about 80.32 percent of the family, so one resident preamble copy catches nearly all of its traffic.
  3. The balance cost: if the family is 30 percent of all fleet traffic, the hash card absorbs 80.32 percent of 30 = about 24.1 points of fleet load, which is why the hot card needs queue-depth-aware overflow.

Round-robin balances and starves the cache; the hash feeds the cache and concentrates load. 80.32 percent on one card versus 1.56 everywhere is the trade, stated in two round numbers.

Where this shows up

Test yourself

Related terms