Reference guide · http-status · Published 2026-08-16 · 4 min read

HTTP 503 from a load balancer during origin drain

503 during a load-balancer origin drain: warm the unhealthy origin, drop it from the pool, route health checks and keep clients retrying correctly.

Why a load balancer says 503

A load balancer (cloud LB, Cloudflare Load Balancing pool, or an origin pool in front of the site) answers 503 when it has no healthy origin to forward traffic to. Its job is to send you to one; if all configured backends fail health checks, it replies 503 with a connection-refused or "no healthy upstream". The same mechanism serves the site down page a moment before failover, and it hides the origin now, so the health check is the only probe that matters.

The three health-check phases

PhaseWhat the LB watchesWhat the 503 means
Origin warmingHTTP code on the health pathWait until the origin answers healthy
DrainOrigin marked healthy but in "drain", removed from trafficThe LB answers by design while the pool empties
FailoverThe fallback originThe same 503 if no fallback is healthy

Drain vs remove

A load balancer that keeps an origin in "draining" stops new connections to it but waits for in-flight requests to finish. The Cloudflare origin pool article has the exact pool semantics. The 503 during a drain is different from the 503 of a dead origin: drain is deliberate and temporary, and the LB answers 503 when every pool member is draining or down.

What to do in each case:

Verify the health check is honest

The 503 is only as truthful as the health check. A path that returns 200 for the whole site's load path ("/healthz" that hits only the app and not the DB) makes the pool healthy until the first bad request, then the mix of edge 503 and app errors. Make the health check depend on the true dependencies of serving a page.

The uptime monitoring article covers external monitors; a health probe sits closer to the host and runs before any external monitor fires.

Retry semantics for clients

A client that retries a 503 can help or hurt:

Verify the drain

  1. The LB console shows the origin toggling to draining/down.
  2. The health-probe log at the origin stops receiving probes.
  3. The error log shows connection attempts to the removed origin (or its engine) during the drain window, then silence.
  4. External checks show the site up once the fallback serves.

Prevention

Where the site uses a single origin with no LB, the 503 is the web server's own response and the 503 reference article is the fix list. Where the load balancer gives up and times out instead, the 504 gateway article is the adjacent symptom.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services