The load balancer hashes each client's IP address and uses the result to pick a server, so the same client always reaches the same server. That keeps sessions and caches on one machine without the servers sharing anything. Below, each client has its own colour: follow them, then see what an office network or a server leaving does to the spread.
Each server drawn stands for one of your servers, and each dot for 100 real requests; the 8 clients stand for groups of users. Each client always sends from the same address. Switching the algorithm restarts the run with exactly the same requests from the same clients.
Busiest hour vs the daily average. The book's estimate uses 2x.
Measured by load testing one server until it cannot go faster.
Headroom for spikes and for uneven hashing. 50 to 70% is common.
1. Average requests per second
2. Peak requests per second
3. Servers needed n
4. Load on each server, if hashing spreads evenly
5. One address sending 0% of requests
6. A server leaving
Steps 1 and 2 are the estimation method from the back-of-the-envelope chapter of Alex Xu's System Design Interview, Vol. 1, including its 2x peak. Step 6 follows from hashing modulo the number of servers: a key keeps its server when the count changes from n to n - 1 only about 1 time in n. The scene uses only 9 clients, so its counts wander around these averages.
NGINX hashes the client's address; AWS's Network Load Balancer hashes each connection instead.
ip_hash, "The first three octets of the client IPv4 address, or the entire IPv6 address, are used as a hashing key." It "ensures that requests from the same client will always be passed to the same server except when this server is unavailable." To take a server out temporarily, the documentation says to mark it down "to preserve the current hashing of client IP addresses." Its general hash method warns that adding or removing a server "may result in remapping most of the keys"; with consistent, "only a few keys will be remapped".All are the vendors' own documentation (primary sources). Quoted phrases are short attributed quotations; everything else is described in our words. Check the pages for current behaviour.