[erlang-questions] ssl session cache
Wed Jan 13 14:41:49 CET 2016
In 18.2 you should have session cache size limited by 1000 by default — see
Actually I have hit the trouble of many concurrent invalidators on 17.1,
but the number of sessions was about 350000.
Also 18.2 has performance improvements, so you have to keep even more
sessions to die of invalidators.
Try the following:
- Check if tables 'server_ssl_otp_session_cache' and
'client_ssl_otp_session_cache' owned by ssl_manager in 'ets:i()' output
have more entries than configured limit.
- If limiting works well, set the limit to e.g. 50000. This should be
sufficient for invalidator to finish its work in 60 seconds.
- Maybe you have other problem. Check ssl_manager's message_queue. It may
be full of invalidation messages from closing sockets (in my tests closing
400000 sockets simultaneusly blocks the manager for several minutes). You
can distinguish this from invalidator's effects by setting large lifetime
to prevent invalidator from running.
On Tue, Jan 12, 2016 at 6:04 PM, Pawel Kraszewski <>
> I'm struggling with SSL session cache. I've already upgraded to 18.2.1
> (fixed some of my problems), yet one thing bothers me:
> lib/ssl-7.2/src/ssl_manager.erl line 242/243
> SessionLifeTime = proplists:get_value(session_lifetime, Opts,
> Its OK.
> Line 251/252
> Timer = erlang:send_after(SessionLifeTime * 1000 + 5000, self(),
> It's OK. Gives initial addidtional 5s backoff.
> And than suddenly line 383/384
> Timer = erlang:send_after(?SESSION_VALIDATION_INTERVAL, self(),
> From this time on SessionLifeTime "reload" is ignored and forced to 60s.
> I have potentially thousands of short-span SSL connections (simple
> JSON queries via SSL) and session cache grows quickly - even with
> session lifetime set to 10s.
> What gives?
> Paweł Kraszewski
> erlang-questions mailing list
Danil Zagoskin |
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions