<div dir="ltr">Hello,<div><br></div><div>You meant _rel or I need to create a folder "rel" and put sys.config inside?</div><div><br></div><div>Sethy<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 21, 2015 at 5:09 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 09/21/2015 12:05 PM, Sereysethy TOUCH wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Hello,<br>
<br>
My application is both TLS-client & server. It is a web server which<br>
allows client browser to connect to server using websocket. I use cowboy<br>
as web server & web socket server.<br>
<br>
In erlang 17, our application runs for weeks and there is no memory<br>
issue. We only restart it whenever we have a new update. But since we<br>
update to elang 18, we need to restart our application every 2 hours.<br>
<br></span>
I use <a href="http://erlang.mk" rel="noreferrer" target="_blank">erlang.mk</a> <<a href="http://erlang.mk" rel="noreferrer" target="_blank">http://erlang.mk</a>> to compile our application, I am not<span class=""><br>
sure how to set application env. settings. Is it the same if I use<br>
</span><a href="http://erlang.mk" rel="noreferrer" target="_blank">erlang.mk</a> <<a href="http://erlang.mk" rel="noreferrer" target="_blank">http://erlang.mk</a>>?<br>
</blockquote>
<br>
If you run a release, you can put the configuration in the sys.config file (by default rel/sys.config) and run make again. See <a href="http://www.erlang.org/doc/man/config.html" rel="noreferrer" target="_blank">http://www.erlang.org/doc/man/config.html</a> </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Thanks,<br>
Sethy<br>
<br>
On Mon, Sep 21, 2015 at 4:54 PM, Ingela Andin <<a href="mailto:ingela.andin@gmail.com" target="_blank">ingela.andin@gmail.com</a><br></span><span class="">
<mailto:<a href="mailto:ingela.andin@gmail.com" target="_blank">ingela.andin@gmail.com</a>>> wrote:<br>
<br>
Hi!<br>
<br>
<br>
2015-09-21 10:09 GMT+02:00 Sereysethy TOUCH<br></span>
<<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a> <mailto:<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a>>>:<div><div class="h5"><br>
<br>
Hello,<br>
<br>
One question, why did my application work fine on Erlang 17.5.x<br>
branch?<br>
<br>
<br>
Well I am not sure what your application does.<br>
<br>
If you have a client application that spawns a lot of parallel<br>
connections to the same host, not waiting for one to succeed before<br>
spawning,<br>
the client session table could grow a lot. However I have<br>
implemented a feature to only save unique TLS-sessions in this<br>
senario to avoid this, and there was a bug so that this feature did<br>
not work, that I have fix in the maint branch. This bug however was<br>
in 17 as well as 18.<br>
<br>
However the ets info you sent suggest you have a server application<br>
and then setting session_liftime can help keeping the servers<br>
session table<br>
smaller. This also is true for clients, that can get a big table<br>
also through connecting to many diffrent servers.<br>
<br>
Maybe your application can be both a TLS-client and server? There is<br>
no obvious reason from what you told us so far that it should work<br>
better in 17 then 18.<br>
<br>
<br>
If I want to set this session_lifetime option, where should put it?<br>
<br>
<br>
It is an application environment setting. Search for app in the docs.<br>
<br>
<br>
So there is no use that I should build the erlang 18 from maint<br>
branch?<br>
<br>
<br>
<br>
It is always a good thing to try the latest version, and if you<br>
still have a problem it would be good if you could try providing a<br>
way to reproduce the problem.<br>
<br>
Regards Ingela Erlang/OTP tema Ericsson AB<br>
<br>
<br>
Thanks,<br>
Sethy<br>
<br>
On Mon, Sep 21, 2015 at 2:51 PM, Ingela Andin<br></div></div><span class="">
<<a href="mailto:ingela.andin@gmail.com" target="_blank">ingela.andin@gmail.com</a> <mailto:<a href="mailto:ingela.andin@gmail.com" target="_blank">ingela.andin@gmail.com</a>>> wrote:<br>
<br>
Hello,<br>
<br>
2015-09-20 15:24 GMT+02:00 Sereysethy TOUCH<br>
<<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a><br></span>
<mailto:<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a>>>:<div><div class="h5"><br>
<br>
Hello,<br>
<br>
I did as what you told me by getting a shell console on<br>
the node.<br>
<br>
I run memory(). and see ets ate the most memory. And it<br>
increased overtime. I run ets:i(). and I found out the<br>
ssl_manager took a big chunk of what memory used.<br>
<br>
32794 client_ssl_otp_session_cache ordered_set<br>
0 89 ssl_manager<br>
36891 server_ssl_otp_session_cache ordered_set<br>
1564 67995 ssl_manager<br>
40993 httpc_manager__session_cookie_db bag 0<br>
299 httpc_manager<br>
<br>
So I think there is a problem with ssl_manager in Erlang<br>
OTP 18.<br>
<br>
Any workarounds?<br>
<br>
<br>
<br>
Ok, the bug I fixed with the session table is on the client<br>
side. But your big ets table is on the server side.<br>
Session data is by default fairly long lived (24 h that is<br>
the max recommended time to keep a session by the RFC),<br>
you can set the ssl application variable session_lifetime to<br>
make its lifetime shorter which should mitigate your problem.<br>
We have a backlog item to make a configurable threshold of<br>
max sessions allowed to be stored in the table, which I am<br>
sure will be<br>
implemented fairly soon but alas not for 18.1.<br>
<br>
Regards Ingela Erlang/OTP Team - Ericsson AB<br>
<br>
Sethy<br>
<br>
On Sun, Sep 20, 2015 at 2:22 AM, Jesper Louis Andersen<br>
<<a href="mailto:jesper.louis.andersen@gmail.com" target="_blank">jesper.louis.andersen@gmail.com</a><br></div></div><span class="">
<mailto:<a href="mailto:jesper.louis.andersen@gmail.com" target="_blank">jesper.louis.andersen@gmail.com</a>>> wrote:<br>
<br>
<br>
On Sat, Sep 19, 2015 at 6:34 PM, Sereysethy TOUCH<br>
<<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a><br></span><span class="">
<mailto:<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a>>> wrote:<br>
<br>
I just recently updated Erlang to latest version<br>
OTP 18 on Ubuntu server. It uses cowboy<br>
(websocket), ranch, ssl, erlydtl & rabbitmq. It<br>
used to work fine in OTP 17. The program is<br>
correctly compiled but during the execution the<br>
memory kept increasing. I need to restart the<br>
process every one or two hours to free some memory.<br>
<br>
<br>
1. Get a shell console on the node<br>
2. call 'memory().' in the shell<br>
3. If it reports ets as the winner, call<br>
4. ets:i().<br>
<br>
This will give you a nice overview for where to look<br>
and verify it is the SSL problem.<br>
<br>
<br>
--<br>
J.<br>
<br>
<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br></span>
<mailto:<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/listinfo/erlang-questions</a><span class=""><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<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/listinfo/erlang-questions</a><br>
<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
Loïc Hoguin<br>
<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
Author of The Erlanger Playbook,<br>
A book about software development using Erlang<br>
</div></div></blockquote></div><br></div></div></div>