3 ms·
How do you tell the load balancer to stop sending traffic? I've done two ways in previous jobs: - Refuse all new connections. If you can change the program, th
by sleepydog 8y ago
How do you tell the load balancer to stop sending traffic? I've done two ways in previous jobs:
- Refuse all new connections. If you can change the program, this can be done by closing the listening socket (I think) , but I just installed an iptables rule.
- use the load balancer's API to offline the server(at the time it was F5).
I liked the first solution because it was load balancer agnostic, but required retries by the load balancer or client to avoid disruptions. Curious to hear what other people did.
- kyrra 8y agoSee the lameduck section of this chapter of the Google SRE book. They do frequent health checks on all running jobs. If a health check fails they stop sending that job traffic. The concept of lameduck is you report yourself as unhealthy but are still available to serve traffic, you wait before all of your clients that were loaded balanced to you before you stop a sending traffic. https://landing.google.com/sre/book/chapters/load-balancing-datacenter.html https://landing.google.com/sre/book/chapters/load-balancing-... Health checks are part of GCPs load balancer. https://cloud.google.com/compute/docs/load-balancing/health-checks https://cloud.google.com/compute/docs/load-balancing/health-...
- z3t4 8y agoI think it's best if the client can handle the load balancing by connecting to a random server, and have some servers built into the source for bootstrapping. The client can know what to do if the connection closes and handle interruptions.