Question

When will a load balancer stop directing traffic to an unhealthy node?

I’ve set up a load balancer that directs traffic to two droplets. A health check is set up and traffic is split between the two hosts as it should be.

When I take one of the droplets out of the pool, the load balancer still sends traffic to this droplet until the droplet is marked unhealthy by the health checks. This results in 503 errors on the client.

I’ve found an support article regarding this issue, which states:

DigitalOcean Load Balancers return an HTTP 503 error when there are either no target Droplets assigned to the load balancer, or all of the target Droplets are unhealthy.

Neither is the case, as there are droplets assigned to the load balancer and there is still one healthy droplet left.

How am I still getting these 503 errors? I was expecting to be able to take a droplet out of the pool seamlessly.


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 15, 2022

Hi there,

Once a Droplet is marked as unhealthy it will no longer receive traffic, however keep in mind that it can take a few seconds before it is marked as unhealthy. For example, if your health check is set to run every 10 seconds, and the threshold is set to 3, then this means that there might be a period of 30-40 seconds that the Droplet is still marked as healthy but is receiving traffic.

There are a couple of things that I could suggest:

  • Tweak your health checks, for example, you could set the ‘Check Interval’ to 5 seconds rather than 10 seconds and lower down the ‘Unhealthy Threshold’ value, that way the Droplet will be marked as not healthy quicker.

  • Keep in mind that if you are using Sticky sessions and Backend keepalive, your clients will be forwarded to one backend, so there might be a couple of requests that fail if the Droplet is shut down before it is marked as unhealthy

How do you take out the Droplet of the pool, do you shut it down?

Best,

Bobby