Scaling / 2 / 5
Load balancing
One balancer, three app servers. How the balancer chooses where each request goes, why the wrong choice leaves one server burning while the others idle, how it notices a dead server, and what sticky sessions really cost.
- 13 min
- Intermediate
- 12 steps
- Requests
- 900 /s
- Latency p99
- 140 ms
- Errors
- 0 %
- Busiest server
- 35 %
- request
- reply
- redelivery
- duplicate
- lost
Numbers are a model scenario, not measurements
The real request
Load balancer → Server BRequest
TCP 198.51.100.7:52114 -> 192.0.2.12:84431
handshake: SYN, SYN-ACK, ACK
payload: TLS records, unreadable here2
backend chosen once per connection3
TCP— The balancer's whole view: who connects to which port.TLS— The traffic is encrypted end to end. The balancer cannot see paths or headers.per connection— One decision per connection. Every request on that connection goes to the same server.
Course: 42 lessons
01 Foundations
02 Scaling
03 Data & storage
04 Communication
05 Reliability
06 Architecture
07 Security
08 Shipping
09 Whole systems
10 Business processes