<div dir="ltr">Hi!<br><br><div><div class="gmail_extra">2017-08-21 13:36 GMT+02:00 Danil Zagoskin <span dir="ltr"><<a href="mailto:z@gosk.in" target="_blank">z@gosk.in</a>></span>:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">https://github.com/erlang/otp/<wbr>commit/<wbr>256e01ce80b3aadd63f303b9bda572<wbr>2ad313220f</a><br>     -- we start invalidation only on Size == Max</div><div>  2. (<a href="mailto:flussonic@127.0.0.1" target="_blank">flussonic@127.0.0.1</a>)33> (sys:get_state(ssl_manager))#<wbr>state.session_cache_server_<wbr>max.</div><div>     > 1000<br>  3. (<a href="mailto:flussonic@127.0.0.1" target="_blank">flussonic@127.0.0.1</a>)37> redbug:start("ssl_session_<wbr>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"><div><div class="h5"><br></div></div></div></blockquote><div><br></div><div>Humm... maybe something was changed, that changed the criteria breaking the  assumption, let me ponder that some more.<br></div><div>Would it work for you if the test was changed to Size >= Max ?<br><br></div><div>Regards Ingela Erlang/OTP Team - Ericsson AB <br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div><div class="h5"><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><b><span class="m_8034238567982225130m_-8618433332239345276gmail-code">"session_cache_client_max = integer() <optional></span><br></b></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><b> <span class="m_8034238567982225130m_-8618433332239345276gmail-code">session_cache_server_max = integer() <optional></span></b></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="m_8034238567982225130HOEnZb"><div class="m_8034238567982225130h5"><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_8034238567982225130m_-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" 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></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_8034238567982225130gmail_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>
</font></span></div>
</blockquote></div><br></div></div></div>