We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Load Balancing Proxies
Free preview: the first 2 parts of this 10-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Load Balancing Proxies
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
Every rule so far in this chapter has been a function of the request. Same path, same backend. Same hostname, same backend. Same header, same backend.
A weight is not a function. It is a coin, tossed once per request.

Send the same request twice under a matching rule and it goes to the same place twice. Under a weight it may not.
Everything else in this lesson follows from that one sentence. A user is not routed by a weight; each of their requests is. A percentage of traffic is not a percentage of users. And what you observe over a small number of requests is a sample, not the ratio.
Here is all of that, computed.

No network in this one. It is the arithmetic of a coin tossed once per request, seeded so it reproduces exactly.
Start with block A, because it is the number that changes how people talk about canaries.

The weight is applied to every request, so a user with a twenty-request session gets twenty chances to land on the new version.
That is the number to quote when somebody says a one percent rollout is safe. One percent of requests still means a noticeable fraction of users encountering the new version at least once, and a user who hits the new version once for a broken checkout has had a broken checkout.
A canary is only a small blast radius if a partial failure is harmless. A page that renders slightly wrong once, fine. A payment that fails once, not fine.

The percentage is the same. What changes is whether a given person is consistently on one side of it.
Choose deliberately. For draining load off an overloaded pool, a coin per request is exactly right and stickiness would be a liability. For anything a person experiences as a version of your product, hash a key, and accept that you are now doing affinity routing with a weight in front of it, including everything the affinity lessons said about skew and rebalancing.