Aravind
Aravind

Reputation: 221

HAProxy maxconn 1

I was just going through the HAProxy. Articles suggests that having the maxconn set to 1 is a significant life saver and a clear +1 over nginx. What are the benefits of setting maxconn config to 1?

Upvotes: 0

Views: 567

Answers (1)

Willy Tarreau
Willy Tarreau

Reputation: 3424

It only serves with some servers which are incapable of processing multiple requests at once and which can only serialize them. Under such conditions, you definitely don't want to send new requests to busy servers, because these requests would have to wait until the server is free again. Maxconn 1 ensures that the request can be distributed to another server in case there is some room somewhere else when a server is already being used. Otherwise the request sits in the queue and is assigned to the first server to release a connection.

Also, with such servers, it helps to have large buffers in haproxy in order to quickly drain and buffer the response and release the server while sending data to the client.

Upvotes: 4

Related Questions