HAProxy served 503s and I don’t know why

503-errorhaproxy

Yesterday, for around 10 minutes, my haproxy served a lot of 503 pages (directly from errorfile 503 /etc/haproxy/errors/503.http) and I don't know why. I have no health checks to my backends, so for sure these were not marked as disabled. The stats page doesn't show that a limit was reached (in the marked red areas).

haproxy stats page

global
    maxconn 20000
    tune.ssl.default-dh-param 2048
    daemon
    ...

defaults
    log     global
    mode    http
    timeout http-request 30s
    option  httplog
    option  dontlognull
    timeout connect 5s
    timeout server 120s
    timeout client 30s
    ...

frontend frontend_for_all_sites
    maxconn 20000
    mode http
    bind *:80

    option http-buffer-request
    timeout http-request 30s

    ...

    use_backend www_backend      if acl_hostname_www
    use_backend static_backend   if acl_hostname_static

backend www_backend
    option forwardfor
    server www localhost:9090 maxconn 5000

backend static_backend
    option forwardfor
    server s localhost:9090 maxconn 5000

Where should I look at next to figure out why did that happen?

Best Answer

Have you set default_backend ?

If

use_backend www_backend      if acl_hostname_www
use_backend static_backend   if acl_hostname_static

fails, there is not default backend, hence 503