Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum number of globally registered processes

Is there a limit to the number of processes that can be register globally? Or is this only limited by the memory/ max number of atoms ?

Ubuntu 12.04 and Erlang R15B01.

like image 940
Agustin Cautin Avatar asked May 13 '12 13:05

Agustin Cautin


1 Answers

Good question! I'd bet on the number of atoms, if you take into account the following. The Efficiency Guide has a section on system limits:

Processes
The maximum number of simultaneously alive Erlang processes is by default 32768. This limit can be raised up to at most 268435456 processes at startup (see documentation of the system flag +P in the erl(1) documentation). The maximum limit of 268435456 processes will at least on a 32-bit architecture be impossible to reach due to memory shortage.

Distributed nodes
Known nodes
A remote node Y has to be known to node X if there exist any pids, ports, references, or funs (Erlang data types) from Y on X, or if X and Y are connected. The maximum number of remote nodes simultaneously/ever known to a node is limited by the maximum number of atoms available for node names. All data concerning remote nodes, except for the node name atom, are garbage-collected.

Also, the erl manual section describes the flag you can use to alter the number of processes in your node:

+P Number
Sets the maximum number of concurrent processes for this system. Number must be in the range 16..134217727. Default is 32768.

Since you can alter the number of concurrent processes per node, but you cant alter the number of allowed atoms, and the process names are atoms which are copied in replica per node, that should be the total allowed number of globally registered processes.

Hope it helps :)

EDIT: Actually, turns out you can change the number of allowed atoms :)

    Atoms
By default, the maximum number of atoms is 1048576. This limit can be raised or lowered using the +t option.

+t size
Set the maximum number of atoms the VM can handle. Default is 1048576.
like image 87
marcelog Avatar answered Oct 15 '22 15:10

marcelog