gpt4 book ai didi

erlang - 全局注册进程最大数量

转载 作者:行者123 更新时间:2023-12-02 03:09:14 24 4
gpt4 key购买 nike

全局注册的进程数量有限制吗?或者这仅受内存/最大原子数的限制?

Ubuntu 12.04 和 Erlang R15B01。

最佳答案

好问题!如果考虑到以下因素,我会打赌原子的数量。 Efficiency Guide 有一个关于系统限制的部分:

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.

此外,erl manual section 描述了可用于更改节点中进程数量的标志:

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

由于您可以更改每个节点的并发进程数,但无法更改允许的原子数,并且进程名称是在每个节点的副本中复制的原子,因此这应该是全局注册进程的允许总数.

希望有帮助:)

编辑:实际上,事实证明您可以更改允许的原子数量:)

    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.

关于erlang - 全局注册进程最大数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10572336/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com