Introduction to Load Balancers 00:00:01 Four ticket windows take turns Four equal ticket windows receive work in a strict cycle. The fifth request is a long report. Predict which window receives it and whether the next cycle notices its extra work. The first request goes to server A. The next one goes to B. Then C and D. Request 5 starts the circle again. Request 5 is a long report. A is busy, yet it still gets every fourth request. Round robin is easy to predict and keeps selection inexpensive. Equal request counts do not imply equal busy time when orders have different costs. 00:00:43 Three turns, two turns and one turn Three workers have capacity weights of three, two and one. Trace a smooth weighted sequence and count how many of the first six turns each worker receives. Credits are 3, 2 and 1. A is highest and pays 6. A has 0 again, B has 4 and C has 2. B is chosen. A, B and C have 3, 0 and 3. A comes first in a tie. Now C has 4 and gets its one turn in six. B has 4 again. A has 6, pays 6, and everyone is back at zero. The weights describe a target share over multiple choices. A short prefix can contain ties, and a static weight cannot detect a worker that recently became unhealthy. 00:01:41 Give the next customer to the shortest line Three workers have five, two and eight active requests. Send new arrivals to the worker with the least active work and watch those counts change as it accepts them. A has 5 open requests, B has 2 and C has 8. The next request goes to B, which now has 3. B still has the fewest, so it gets the next ones until it catches up. C finishes slowly, keeps 8 open, and receives nothing new for now. Connection or request count is a proxy for remaining work. A worker serving one expensive stream can still be busier than another handling several tiny requests. 00:02:25 Repair one worker without interrupting the rest A worker fails its health probes while others keep serving. Later a planned maintenance window retires a different worker. Follow the distinct conditions for removing eligibility and ending existing work. Every 10 seconds each server answers its probe. Two probes fail. B still receives traffic, and those requests fail. The third failure in a row removes B. B passes twice in a row and returns. C will be upgraded. It gets no new requests and finishes the 4 it has. C has nothing open. Now it can stop without cutting anyone off. Allow a retiring worker's in-flight requests to finish within a bounded drain period. Choose health thresholds that balance detection delay against unnecessary traffic churn. 00:03:17 The fastest failure looks like free capacity One of three workers now replies immediately with an error. Predict which worker least-connections routing may choose repeatedly if it sees only the number of open requests. Three servers share the load. C answers every request at once with an error, so it has nothing open. Almost all new requests go to C and fail. A passive check notices the errors and removes C for a while. Combine selection with meaningful outcome-based health signals. A short queue can mean excellent service, very little demand, or an immediate failure that leaves no work outstanding.