<div dir="ltr">Hi Ingela!<div><br></div><div>We've hit presumably the same bug on OTP 20.</div><div>That's what I found:</div><div> 1. This patch <a href="https://github.com/erlang/otp/commit/256e01ce80b3aadd63f303b9bda5722ad313220f">https://github.com/erlang/otp/commit/256e01ce80b3aadd63f303b9bda5722ad313220f</a><br> -- we start invalidation only on Size == Max</div><div> 2. (<a href="mailto:flussonic@127.0.0.1">flussonic@127.0.0.1</a>)33> (sys:get_state(ssl_manager))#state.session_cache_server_max.</div><div> > 1000<br> 3. (<a href="mailto:flussonic@127.0.0.1">flussonic@127.0.0.1</a>)37> redbug:start("ssl_session_cache:size/1 -> return", [{msgs, 2}]).<br> ...<br> ssl_session_cache:size/1 -> 8610379</div><div><br></div><div>Seems like on high load if we accept some new sessions while session_validation does its job, cache size limiting stops working.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 8, 2017 at 4:55 PM, Ingela Andin <span dir="ltr"><<a href="mailto:ingela.andin@gmail.com" target="_blank">ingela.andin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><dl><dt>Hi!</dt></dl><p>Depending on the version of the ssl application you may also set these values. I guess you have an older version as they default to 1000.</p><p>From doc:<br></p><dl><dt><strong><span class="m_-8618433332239345276gmail-code">"session_cache_client_max = integer() <optional></span><br></strong></dt><dd><p>Limits the growth of the clients session cache, that is
how many sessions towards servers that are cached to be used by
new client connections. If the maximum number of sessions is
reached, the current cache entries will be invalidated
regardless of their remaining lifetime. Defaults to
1000.</p></dd><dt><strong> <span class="m_-8618433332239345276gmail-code">session_cache_server_max = integer() <optional></span></strong></dt><dd><p>Limits the growth of the servers session cache, that is
how many client sessions are cached by the server. If the
maximum number of sessions is reached, the current cache entries
will be invalidated regardless of their remaining
lifetime. Defaults to 1000."</p></dd></dl><p><br></p><p>Regards Ingela Erlang/OTP Team - Ericsson AB<br></p><p><br></p><p><br></p></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-08-08 11:25 GMT+02:00 Dmitry Kolesnikov <span dir="ltr"><<a href="mailto:dmkolesnikov@gmail.com" target="_blank">dmkolesnikov@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
Have you tried to disable reuse of ssl sessions?<br>
{ssl_options, [{reuse_sessions, false}]}<br>
<br>
And reduce the session time<br>
-ssl session_lifetime 120<br>
<br>
Best Regards,<br>
Dmitry<br>
<div><div class="m_-8618433332239345276h5"><br>
> On 8 Aug 2017, at 11.59, Max Treskin <<a href="mailto:zerthurd@gmail.com" target="_blank">zerthurd@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> I have two different HTTPS-servers (different purposes, code, etc) built on top of cowboy/ranch, and both have memory leaks.<br>
> ETS table server_ssl_otp_session_cache has millions of records just after hours of work and consumes gigabytes of RAM.<br>
> What should I do to eliminate this? Is it bug or intended behaviour?<br>
><br>
> Thanks<br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://erlang.org/mailman/list<wbr>info/erlang-questions</a><br>
<br>
______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://erlang.org/mailman/list<wbr>info/erlang-questions</a><br>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font face="'courier new', monospace">Danil Zagoskin | <a href="mailto:z@gosk.in" target="_blank">z@gosk.in</a></font></div></div></div>
</div>