maxconn limit per backend in haproxy

Viewed 5299

Our haproxy loadbalancer opens thousands of connections to its backends even though its settings say to open no more than 10 connections per server instance (see below). When I uncomment "option http-server-close" the number of backend connection drops however I would like to have keep-alive backend connections.

Why maxconn is not respected with http-keep-alive? I verified with ss that the opened backend connections are in ESTABLISHED state.

defaults
     log global
     mode    http
     option http-keep-alive
     timeout http-keep-alive 60000
     timeout connect 6000
     timeout client  60000
     timeout server  20000


 frontend http_proxy
     bind    *:80
     default_backend backends

 backend backends
     option prefer-last-server

     # option http-server-close
     timeout http-keep-alive 1000
     server s1 10.0.0.21:8080 maxconn 10
     server s2 10.0.0.7:8080  maxconn 10
     server s3 10.0.0.22:8080 maxconn 10
     server s4 10.0.0.16:8080 maxconn 10
1 Answers
Related