Haproxy maxconn meaning

haproxyulimit

In the haproxy config file, there is a directive called maxconn.

does this directive refer to concurrent connections? Or once the connection is redirected to a server, it is closed? For example, if the maxconn is set to 4000, and in my whole website there are 10k people, would that directive limit that users number?

Thank you

Best Answer

It sets the maximum number of concurrent connections. Each connection lasts as long as that request (or, with keep-alive, that set of requests).

So, yes, if all 10,000 users are making a request at the exact same time, then a maxconn setting of 4000 will limit that.

Additionally, most modern browsers open more than one TCP connection when they have a long list of resources to request - this multiplexing allows for resources to load more quickly in general, but increases the effective number of connections that your load balancer sees.