very long init:stop() and +P emulator flag

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

very long init:stop() and +P emulator flag

Vyacheslav Levytskyy-2
Hi,

I've experienced very long duration of Erlang node shutdown after
init:stop() : about 8 minutes. At last I've found a solution -- when I
remove emulator flag for the maximum number of simultaneously existing
processes (+P 134217727) the shutdown of the node return to normal
couple of seconds.

I'm using Erlang/OTP 20.0 on Ubuntu LTS 16.04, node runs in embedded
mode. The problem with long shutdown happens after all applications have
already gone, and just 30-40 processes and about 10 ports of kernel
remains running. Actually it happens even after a clean boot with just
kernel and stdlib applications started. Option -shutdown_time does not
help. The only solution that works for me at the moment is to remove +P
134217727 -- maybe decreasing the number of simultaneously existing
processes helps as well (it should), but I did not check that and did
not search after which value of +P the problem would disappear.

I'm quite puzzled with relations between +P and really long init:stop(),
and would like to ask if somebody can explain that?

Vyacheslav


.
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: very long init:stop() and +P emulator flag

Tristan Sloughter-4
I checked and running erl with that +P 134217727 results in a beam
process using 1.517g of memory. So cleaning that up is probably what is
taking so much time on shutdown :)

134217727 certainly seems excessive... What size system would even be
able to handle dealing with that many processes?

--
  Tristan Sloughter
  "I am not a crackpot" - Abe Simpson
  [hidden email]

On Mon, Sep 25, 2017, at 12:02 PM, Vyacheslav Levytskyy wrote:

> Hi,
>
> I've experienced very long duration of Erlang node shutdown after
> init:stop() : about 8 minutes. At last I've found a solution -- when I
> remove emulator flag for the maximum number of simultaneously existing
> processes (+P 134217727) the shutdown of the node return to normal
> couple of seconds.
>
> I'm using Erlang/OTP 20.0 on Ubuntu LTS 16.04, node runs in embedded
> mode. The problem with long shutdown happens after all applications have
> already gone, and just 30-40 processes and about 10 ports of kernel
> remains running. Actually it happens even after a clean boot with just
> kernel and stdlib applications started. Option -shutdown_time does not
> help. The only solution that works for me at the moment is to remove +P
> 134217727 -- maybe decreasing the number of simultaneously existing
> processes helps as well (it should), but I did not check that and did
> not search after which value of +P the problem would disappear.
>
> I'm quite puzzled with relations between +P and really long init:stop(),
> and would like to ask if somebody can explain that?
>
> Vyacheslav
>
>
> .
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: very long init:stop() and +P emulator flag

Vyacheslav Levytskyy-2
In reply to this post by Vyacheslav Levytskyy-2

That's true, I don't need 134217727 processes to be running, but it is not substantial. It is just counter intuitive for me to have a beam process with only kernel+stdlib that must take 5-10 minutes to shutdown.

If you are right and this indeed happens because of 1,5Gb allocated (btw does this mean that each of 134217727 potential processes is pre-created?), I would say that setting an upper bound of something I don't expect immediate actions. Out of curiosity, I wonder what should be cleaned up in the system immediately after the clean boot, and did this behaviour exist earlier or was introduced recently (maybe as an optimization) with Erlang/OTP 19 or 20?

Vyacheslav

On 25.09.2017 23:46, Vyacheslav Levytskyy wrote:
I checked and running erl with that +P 134217727 results in a beam
process using 1.517g of memory. So cleaning that up is probably what is
taking so much time on shutdown :)

134217727 certainly seems excessive... What size system would even be
able to handle dealing with that many processes?

-- 
  Tristan Sloughter
  "I am not a crackpot" - Abe Simpson
  


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions