What exact haproxy release is this?
Please provide the output of “haproxy -vv”

The “sQ” log line means a queue timeout, so this is about saturating the “maxconn 100” on your server configuration line.
Raise the maxconn value (or timeout queue) or troubleshoot why your queues are so full.

This is about queuing in haproxy not the systems, therefor sysctls are irrelevant for this problem.

The queue problem is due to many “automatic connections” to my application once HAProxy started (via sudo service haproxy restart). These connections happen even if no browser is connected to https://www.my-domain.com

I see a new connection on the server console approximately each second :

a user connected
a user connected
a user connected

and as many “user disconnected” when HAProxy is stopped.

I did several tests has restrict socket.io origins and changing HAProxy parameters, unsuccessfully.
I do not have such behaviour with the pure node based application.

Can confirm you are not using compression in haproxy (not through haproxy, I mean haproxy actively compresses content - the “compression” keyword needs to appear in the config for this)? If yes, than a bug could be the issue, which is fixed in 1.7.8.

If you don’t have “compression” in your config, then that’s not it.

Can you provide the log output when haproxy closes, I would like the see the timings of requests.

Matthieu_HPP:

The queue problem is due to many “automatic connections” to my application once HAProxy started (via sudo service haproxy restart). These connections happen even if no browser is connected to https://www.my-domain.com

Well you do have health checks configured, so that is the reason haproxy continually makes requests to your server, but that should not affect maxconn at all. You can try disabling health checks?

Could be haproxy, if you have configured haproxy to connect to itself (but it doesn’t seem like it from the configuration you provided here).
Are there additional sections in your haproxy configuration that you did not share here?

This is a user space application on your VPS that connects to 443. While haproxy is running an connections are queued up, use the following command to print out all connections along with its application:sudo netstat -tnp

It comes from a plugins attached to the Javascript framework I am using, that is called every second as soon as HAProxy and my application are both started.
The plugins is in charge of socket.io handshakes so it creates a new user every second and saturates the server after some minutes.