<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">As explained in the documentation for max_connections, this is a soft limit. </blockquote><div><br></div><div>I can't find any thing about soft limit in <a href="http://ninenines.eu/docs/en/cowboy/HEAD/guide/architecture/">http://ninenines.eu/docs/en/cowboy/HEAD/guide/architecture/</a></div><div><br></div>Do I understand correctly, that the <span style="font-family:arial,sans-serif;font-size:13px">{backlog, Backlog} option set the socket backlog size. The </span><font face="arial, sans-serif">{max_connections, MaxConnections} option set the soft limit connections count (i.e. accepted connections?), and if the real connections count gather then MaxConnections, cowboy do <a href="https://github.com/ninenines/ranch/blob/master/src/ranch_conns_sup.erl#L127">https://github.com/ninenines/ranch/blob/master/src/ranch_conns_sup.erl#L127</a>, but what happens with after that? Can you explain please?</font><div class="gmail_extra"><br><div class="gmail_quote">2014-11-04 15:26 GMT+03:00 Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
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.<br>
<br>
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.<div><div class="h5"><br>
<br>
On 11/04/2014 02:21 PM, Alexander Petrovsky wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5">
Hi!<br>
<br>
Until recently, I thought that I can do "connection" back pressure from<br>
cowboy like:<br>
<br>
    NbAcceptors = 256,<br>
    Backlog = 256,<br>
    MaxConnections = 256,<br>
<br>
    cowboy:start_http(http, NbAcceptors, [{port, ...}, {backlog,<br>
    Backlog}, {max_connections, MaxConnections}], [{env, ...}]),<br>
<br>
<br>
But some times ago I'm observed that I can't, the<br>
"ranch_server:count_<u></u>connections/1" says that active ranch connection was<br>
gather than 256.<br>
While the "ss -lt" show me that ranch socket backlog is 256. And I can't<br>
understand why?<br>
<br>
- Does the "ranch_server:count_<u></u>connections/1" show not only active<br>
connections in ESTABLISHED state, but and the TIME_WAIT state?<br>
- How can I properly do connection back pressure with ranch and cowboy?<br>
<br>
--<br>
Петровский Александр / Alexander Petrovsky,<br>
<br>
Skype: askjuise<br>
Phone: +7 914 8 820 815<br>
<br>
<br>
<br></div></div>
______________________________<u></u>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br>
<br><span class=""><font color="#888888">
</font></span></blockquote><span class=""><font color="#888888">
<br>
-- <br>
Loïc Hoguin<br>
<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Петровский Александр / Alexander Petrovsky,<br><br>Skype: askjuise<br><div>Phone: +7 914 8 820 815<div><br></div></div></div></div>
</div></div>