HAProxy community

Setting `pool-max-conn` to `0` not closing idle connections in HAProxy 2.0

HAProxy 2.0 configuration

global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
#maxconn 65536

defaults
log global
mode http
option httplog
http-reuse never
no log
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http

frontend test
bind :80
mode http
maxconn 65536
default_backend nginx

backend nginx
mode http
balance leastconn
server 10.32.95.110 10.32.95.110:81 weight 255 pool-max-conn 0 pool-purge-delay 0
server 10.32.110.236 10.32.110.236:81 weight 255 pool-max-conn 0 pool-purge-delay 0
server 10.33.238.57 10.33.238.57:81 weight 255 pool-max-conn 0 pool-purge-delay 0

When making multiple requests over 1 connection using wrk tool, connection to backend is not closed after another backend is selected as per the load balancing algorithm used. Instead old connections are kept idling and re-used when algorithm choses that server. Please let me know if this is expected.

Handled in the other thread.