<div dir="ltr">Something like this?<div><br></div><div>







<p class=""><span class=""><font face="monospace, monospace">{release, {ws_user, "1"},</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">  Â  Â  Â  [ws_user]}.</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">{sys_config, "./config/sys.config"}.</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">%{paths, ["../deps/"]}.</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">% generate startup script, yes</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">{extended_start_script, true}.</font></span></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 21, 2015 at 5:46 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">Add {sys_config, "path/to/sys.config"} to your relx.config, then create that sys.config file with the right options and run make.<span class=""><br>
<br>
On 09/21/2015 12:44 PM, Sereysethy TOUCH wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br><span class="">
You meant _rel or I need to create a folder "rel" and put sys.config inside?<br>
<br>
Sethy<br>
<br>
On Mon, Sep 21, 2015 at 5:09 PM, Loïc Hoguin <<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a><br></span><span class="">
<mailto:<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>>> wrote:<br>
<br>
  Â  On 09/21/2015 12:05 PM, Sereysethy TOUCH wrote:<br>
<br>
  Â  Â  Â  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<br>
  Â  Â  Â  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<br>
  Â  Â  Â  since we<br>
  Â  Â  Â  update to elang 18, we need to restart our application every 2<br>
  Â  Â  Â  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>> <<a href="http://erlang.mk" rel="noreferrer" target="_blank">http://erlang.mk</a>> to compile<span class=""><br>
  Â  Â  Â  our application, I am not<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>> <<a href="http://erlang.mk" rel="noreferrer" target="_blank">http://erlang.mk</a>>?<span class=""><br>
<br>
<br>
  Â  If you run a release, you can put the configuration in the<br>
  Â  sys.config file (by default rel/sys.config) and run make again. See<br>
  Â  <a href="http://www.erlang.org/doc/man/config.html" rel="noreferrer" target="_blank">http://www.erlang.org/doc/man/config.html</a><br>
<br>
<br>
<br>
  Â  Â  Â  Thanks,<br>
  Â  Â  Â  Sethy<br>
<br>
  Â  Â  Â  On Mon, Sep 21, 2015 at 4:54 PM, Ingela Andin<br>
  Â  Â  Â  <<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>><br></span>
  Â  Â  Â  <mailto:<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>>>><span class=""><br>
  Â  Â  Â  wrote:<br>
<br>
  Â  Â  Â  Â  Â  Â Hi!<br>
<br>
<br>
  Â  Â  Â  Â  Â  Â 2015-09-21 10:09 GMT+02:00 Sereysethy TOUCH<br>
  Â  Â  Â  Â  Â  Â <<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a><br>
  Â  Â  Â  <mailto:<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>
  Â  Â  Â  <mailto:<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a>>>>:<br>
<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â Hello,<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â One question, why did my application work fine on<br>
  Â  Â  Â  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<br>
  Â  Â  Â  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<br>
  Â  Â  Â  feature did<br>
  Â  Â  Â  Â  Â  Â not work, that I have fix in the maint branch. This bug<br>
  Â  Â  Â  however was<br>
  Â  Â  Â  Â  Â  Â in 17 as well as 18.<br>
<br>
  Â  Â  Â  Â  Â  Â However the ets info you sent suggest you have a server<br>
  Â  Â  Â  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<br>
  Â  Â  Â  table<br>
  Â  Â  Â  Â  Â  Â also through connecting to many diffrent servers.<br>
<br>
  Â  Â  Â  Â  Â  Â Maybe your application can be both a TLS-client and server?<br>
  Â  Â  Â  There is<br>
  Â  Â  Â  Â  Â  Â no obvious reason from what you told us so far that it<br>
  Â  Â  Â  should work<br>
  Â  Â  Â  Â  Â  Â better in 17 then 18.<br>
<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â If I want to set this session_lifetime option, where<br>
  Â  Â  Â  should put it?<br>
<br>
<br>
  Â  Â  Â  Â  Â  Â It is an application environment setting. Search for app in<br>
  Â  Â  Â  the docs.<br>
<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â So there is no use that I should build the erlang 18<br>
  Â  Â  Â  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<br>
  Â  Â  Â  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>
  Â  Â  Â  Â  Â  Â  Â  Â <<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>><br></div></div>
  Â  Â  Â  <mailto:<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>>>><span class=""><br>
  Â  Â  Â  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>
  Â  Â  Â  <mailto:<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>
  Â  Â  Â  <mailto:<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a>>>>:<br>
<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â Hello,<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â I did as what you told me by getting a shell<br>
  Â  Â  Â  console on<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â the node.<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â I run memory(). and see ets ate the most<br>
  Â  Â  Â  memory. And it<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â increased overtime. I run ets:i(). and I found<br>
  Â  Â  Â  out the<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ssl_manager took a big chunk of what memory used.<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 32794  Â  Â  Â  Â  Â client_ssl_otp_session_cache<br>
  Â  Â  Â  ordered_set<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 0  Â  Â  89  Â  Â  Â ssl_manager<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 36891  Â  Â  Â  Â  Â server_ssl_otp_session_cache<br>
  Â  Â  Â  ordered_set<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 1564  Â 67995  Â  ssl_manager<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 40993<br>
  Â  Â  Â  Â  httpc_manager__session_cookie_db bag  Â 0<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 299  Â  Â  httpc_manager<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â So I think there is a problem with ssl_manager<br>
  Â  Â  Â  in Erlang<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â OTP 18.<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â Any workarounds?<br>
<br>
<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â Ok, the bug I fixed with the session table is on<br>
  Â  Â  Â  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<br>
  Â  Â  Â  that is<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â the max recommended time to keep a session by the RFC),<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â you can set the ssl application variable<br>
  Â  Â  Â  session_lifetime to<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â make  its lifetime shorter which should mitigate<br>
  Â  Â  Â  your problem.<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â We have a backlog item to make a configurable<br>
  Â  Â  Â  threshold of<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â max sessions allowed to be stored in the table,<br>
  Â  Â  Â  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<br>
  Â  Â  Â  Andersen<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â <<a href="mailto:jesper.louis.andersen@gmail.com" target="_blank">jesper.louis.andersen@gmail.com</a><br>
  Â  Â  Â  <mailto:<a href="mailto:jesper.louis.andersen@gmail.com" target="_blank">jesper.louis.andersen@gmail.com</a>><br></div></div>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â <mailto:<a href="mailto:jesper.louis.andersen@gmail.com" target="_blank">jesper.louis.andersen@gmail.com</a><span class=""><br>
  Â  Â  Â  <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<br>
  Â  Â  Â  TOUCH<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â <<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a><br>
  Â  Â  Â  <mailto:<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>
  Â  Â  Â  <mailto:<a href="mailto:touch.sereysethy@gmail.com" target="_blank">touch.sereysethy@gmail.com</a>>>> wrote:<br>
<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â I just recently updated Erlang to<br>
  Â  Â  Â  latest version<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â OTP 18 on Ubuntu server. It uses cowboy<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â (websocket), ranch, ssl, erlydtl &<br>
  Â  Â  Â  rabbitmq. It<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â used to work fine in OTP 17. The program is<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â correctly compiled but during the<br>
  Â  Â  Â  execution the<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â memory kept increasing. I need to<br>
  Â  Â  Â  restart the<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â process every one or two hours to free<br>
  Â  Â  Â  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<br>
  Â  Â  Â  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> <mailto:<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>><br></div></div>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â <mailto:<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><span class=""><br>
  Â  Â  Â  <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><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
  Â  Â  Â  _______________________________________________<br>
  Â  Â  Â  erlang-questions mailing list<br></span>
  Â  Â  Â  <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a> <mailto:<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>><span class=""><br>
  Â  Â  Â  <a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
<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>
<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>