you can improve this be picking top 3 server with least connections and then pick one randomly from these 3 servers.
back
1 comments
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
Caddy has this with `lb_policy random_choose 2`. See https://caddyserver.com/docs/caddyfile/directives/reverse_pr....