HAProxy community

Haproxy throwing intermittent 503 as it can not establish a backend server connection after 4 retries

#1

Hi, We are using haproxy 1.7 with docker image and it is throwing intermittent 503 errors with error code sC, I could see that this is reaching client time out of 15s and after 4 times to connect (3s time to connect).

we are using http-server-close to release backend connections immediately after serving one request.
Is this causing increased connection attempts? can I use http-reuse instead?
Here is my configuration, can you please help me to tune this config.

How can I determine what is the root cause of delay from tcpdump ?

global
ssl-server-verify none
tune.ssl.default-dh-param 2048
tune.maxrewrite 4096
log 127.0.0.1:514 local0
stats socket /opt/haproxy.sock

listen stats #Listen on all IP’s on port 9090
bind *:9090
mode http
balance
timeout client 5000
timeout connect 4000
timeout server 30000
stats enable
stats hide-version
stats refresh 30s
stats show-node
stats uri /haproxy?stats

monitor-uri /status

defaults
log global
mode http
option httplog
option log-health-checks
option dontlognull
timeout client 15000
timeout connect 3000
timeout server 180000
retries 4
option http-server-close

#create new frontend to process 443
frontend https_frontend
bind *:443 ssl crt /opt/ert.pem force-tlsv12
mode http

default_backend backend_https

frontend http_frontend
bind *:80
mode http

default_backend nike_http

#Define backend for above frontend
backend bakend_https
mode http
option httpchk GET /healthchek HTTP/1.1\r\nHost:\ blah
http-check expect ! rstatus ^5
server server blah:443 check inter 40000 ssl verify none

#Define backend for above frontend
backend backend_http
mode http
server blah:80