Repaso
Español
System DesignIntermediateSD-02

Requests have very different durations (some take seconds). Which load balancing strategy adapts best?

Options

  1. Round robin: send requests in a fixed rotation
  2. Least connections: pick the least busy server (Correct option)
  3. Random choice: pick any server for each request
  4. DNS only: one record for each of the servers

Answer

Least connections

Why

Round robin sends requests in turn: server 1, 2, 3, 1, 2, 3... That is fair only if every request costs about the same.

If some requests take seconds, one server can pile up slow requests while it keeps receiving its 'turn'.

Least connections sends each new request to the server that is currently handling the fewest, so busy servers naturally get less.

Remember

Uneven request costs → least connections.

Key terms

Practice this question in Repaso