[erlang-questions] Cowboy back pressure

Loïc Hoguin essen@REDACTED
Tue Nov 4 13:26:42 CET 2014


Hi,

As explained in the documentation for max_connections, this is a soft 
limit. Messages being sent asynchronously, it can go higher than the 
limit, even more significantly if the number of acceptors is close to 
the maximum number of connections.

That said, if you need to reduce the number of connections, why do you 
have so many acceptor processes? The documentation says that 100 is 
already a large enough number. If you want to accept connections slower, 
you should reduce it, not increase it.

On 11/04/2014 02:21 PM, Alexander Petrovsky wrote:
> Hi!
>
> Until recently, I thought that I can do "connection" back pressure from
> cowboy like:
>
>     NbAcceptors = 256,
>     Backlog = 256,
>     MaxConnections = 256,
>
>     cowboy:start_http(http, NbAcceptors, [{port, ...}, {backlog,
>     Backlog}, {max_connections, MaxConnections}], [{env, ...}]),
>
>
> But some times ago I'm observed that I can't, the
> "ranch_server:count_connections/1" says that active ranch connection was
> gather than 256.
> While the "ss -lt" show me that ranch socket backlog is 256. And I can't
> understand why?
>
> - Does the "ranch_server:count_connections/1" show not only active
> connections in ESTABLISHED state, but and the TIME_WAIT state?
> - How can I properly do connection back pressure with ranch and cowboy?
>
> --
> Петровский Александр / Alexander Petrovsky,
>
> Skype: askjuise
> Phone: +7 914 8 820 815
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>

-- 
Loïc Hoguin
http://ninenines.eu



More information about the erlang-questions mailing list