Hi Maksim, On Fri, Jun 28, 2019 at 04:09:48PM +0300, Максим Куприянов wrote: > Hi! > > I found out that in some situations under high rate of incoming connections > haproxy=2.0.1 starts leaking sockets. It looks like haproxy doesn't close > connections to its backends after request is finished (FIN received from > client) thus leaving its server-sockets in close-wait state. > > As an example this simple config starts leaking right from the start for > me. And everything ends with messages: "local0.emerg Proxy > server.local:18400 reached process FD limit (maxsock=4130). Please check > 'ulimit-n' and restart." > > My config look very similar to this: > global > daemon > uid 120 > gid 126 > stats socket /var/run/haproxy.sock mode 700 level admin expose-fd > listeners > master-worker > log 127.0.0.1:516 local0 warning > maxconn 2000 > tune.ssl.default-dh-param 2048 > > defaults > log global > maxconn 4096 > mode tcp > retries 3 > timeout client 1h > timeout connect 5s > timeout server 1h > option redispatch > option dontlognull > > listen server.local:18400 > bind ipv6@::1:18400 tfo > bind ipv4@127.0.0.1:18400 tfo > mode tcp > balance leastconn > > timeout server 24h > timeout client 24h > option dontlog-normal > log 127.0.0.1:516 local1 info > option httpchk GET /check HTTP/1.1\r\nHost:\ server.local > http-check send-state > http-check expect status 200 > tcp-request inspect-delay 10s > tcp-request content reject if { nbsrv lt 1 } > default-server weight 50 > server backend-server.local:17995 backend-server.local:17995 check port > 17994 >
What kind of requests do you do ? GET ? POST ? Others ? Thanks ! Olivier