Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
ed_balls
· 3y ago · 0 comments
you can improve this be picking top 3 server with least connections and then pick one randomly from these 3 servers.
Comments
[–]
lowflyingcondor
3y ago
Inverting this is actually better because it avoids the stale data / herd behavior. i.e. randomly choose X candidate servers and then pick the one with least load. also, 2 may be better than 3
https://brooker.co.za/blog/2012/01/17/two-random.html
[–]
francislavoie
3y ago
Caddy has this with `lb_policy random_choose 2`. See
https://caddyserver.com/docs/caddyfile/directives/reverse_pr...
.