diff options
Diffstat (limited to 'doc/src/guide/listeners.asciidoc')
-rw-r--r-- | doc/src/guide/listeners.asciidoc | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/doc/src/guide/listeners.asciidoc b/doc/src/guide/listeners.asciidoc index 4885c6d..e7ecfec 100644 --- a/doc/src/guide/listeners.asciidoc +++ b/doc/src/guide/listeners.asciidoc @@ -182,9 +182,9 @@ socket and that it is operational. === Limiting the number of concurrent connections The `max_connections` transport option allows you to limit the number -of concurrent connections. It defaults to 1024. Its purpose is to -prevent your system from being overloaded and ensuring all the -connections are handled optimally. +of concurrent connections per connection supervisor (see below). +It defaults to 1024. Its purpose is to prevent your system from being +overloaded and ensuring all the connections are handled optimally. .Customizing the maximum number of concurrent connections @@ -261,6 +261,26 @@ measure to find the best value for your application. echo_protocol, [] ). +=== Customizing the number of connection supervisors + +By default Ranch will use one connection supervisor for each +acceptor process (but not vice versa). Their task is to +supervise the connection processes started by an acceptor. +The number of connection supervisors can be tweaked. + +Note that the association between the individual acceptors and +connection supervisors is fixed, meaning that acceptors will +always use the same connection supervisor to start connection +processes. + +.Specifying a custom number of connection supervisors + +[source,erlang] +{ok, _} = ranch:start_listener(tcp_echo, + ranch_tcp, #{socket_opts => [{port, 5555}], num_conns_sups => 42}], + echo_protocol, [] +). + === When running out of file descriptors Operating systems have limits on the number of sockets |