0

我刚刚通过HAProxy。文章表明,将 maxconn 设置为 1 可以节省大量生命,并且明显优于 nginx。将 maxconn config 设置为 1 有什么好处?

4

1 回答 1

4

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.

于 2012-09-13T23:14:10.383 回答