From 9d20868fea27da833cad1bcd6da7e93fb2809bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 15 Nov 2016 13:27:36 +0200 Subject: Clarify max_connections + NbAcceptors + backlog in the guide --- doc/src/guide/listeners.asciidoc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/src/guide') diff --git a/doc/src/guide/listeners.asciidoc b/doc/src/guide/listeners.asciidoc index a776a58..7a5bdb2 100644 --- a/doc/src/guide/listeners.asciidoc +++ b/doc/src/guide/listeners.asciidoc @@ -174,6 +174,16 @@ You can disable this limit by setting its value to the atom `infinity`. echo_protocol, [] ). +The maximum number of connections is a soft limit. In practice, it +can reach `max_connections` + the number of acceptors. + +When the maximum number of connections is reached, Ranch will stop +accepting connections. This will not result in further connections +being rejected, as the kernel option allows queueing incoming +connections. The size of this queue is determined by the `backlog` +option and defaults to 1024. Ranch does not know about the number +of connections that are in the backlog. + You may not always want connections to be counted when checking for `max_connections`. For example you might have a protocol where both short-lived and long-lived connections are possible. If the long-lived -- cgit v1.2.3