Tune and optimize the Erlang VM (#3195)

This commit is contained in:
Feng Lee 2020-01-17 09:58:34 +08:00 committed by JianBo He
parent a318532bb0
commit 3ae3d8a40d
3 changed files with 14 additions and 18 deletions

View File

@ -221,7 +221,7 @@ node.data_dir = {{ platform_data_dir }}
## Value: Number [1024-134217727] ## Value: Number [1024-134217727]
## ##
## vm.args: +P Number ## vm.args: +P Number
node.process_limit = 2048000 ## node.process_limit = 2048000
## Sets the maximum number of simultaneously existing ports for this system. ## Sets the maximum number of simultaneously existing ports for this system.
## ##
@ -230,7 +230,7 @@ node.process_limit = 2048000
## Value: Number [1024-134217727] ## Value: Number [1024-134217727]
## ##
## vm.args: +Q Number ## vm.args: +Q Number
node.max_ports = 1024000 ## node.max_ports = 1024000
## Set the distribution buffer busy limit (dist_buf_busy_limit). ## Set the distribution buffer busy limit (dist_buf_busy_limit).
## ##
@ -239,7 +239,7 @@ node.max_ports = 1024000
## Value: Number [1KB-2GB] ## Value: Number [1KB-2GB]
## ##
## vm.args: +zdbbl size ## vm.args: +zdbbl size
node.dist_buffer_size = 8MB ## node.dist_buffer_size = 8MB
## Sets the maximum number of ETS tables. Note that mnesia and SSL will ## Sets the maximum number of ETS tables. Note that mnesia and SSL will
## create temporary ETS tables. ## create temporary ETS tables.
@ -247,7 +247,7 @@ node.dist_buffer_size = 8MB
## Value: Number ## Value: Number
## ##
## vm.args: +e Number ## vm.args: +e Number
node.max_ets_tables = 256000 ## node.max_ets_tables = 256000
## Global GC Interval. ## Global GC Interval.
## ##
@ -266,7 +266,7 @@ node.global_gc_interval = 15m
## Value: Number [0-65535] ## Value: Number [0-65535]
## ##
## vm.args: -env ERL_FULLSWEEP_AFTER Number ## vm.args: -env ERL_FULLSWEEP_AFTER Number
node.fullsweep_after = 1000 ## node.fullsweep_after = 1000
## Crash dump log file. ## Crash dump log file.
## ##
@ -289,7 +289,7 @@ node.crash_dump = {{ platform_log_dir }}/crash.dump
## Value: Number ## Value: Number
## ##
## vm.args: -kernel net_ticktime Number ## vm.args: -kernel net_ticktime Number
node.dist_net_ticktime = 60 ## node.dist_net_ticktime = 120
## Sets the port range for the listener socket of a distributed Erlang node. ## Sets the port range for the listener socket of a distributed Erlang node.
## Note that if there are firewalls between clustered nodes, this port segment ## Note that if there are firewalls between clustered nodes, this port segment

View File

@ -10,13 +10,13 @@
## such as `node.name` for `-name` and `node.cooke` for `-setcookie`. ## such as `node.name` for `-name` and `node.cooke` for `-setcookie`.
## Sets the maximum number of simultaneously existing processes for this system. ## Sets the maximum number of simultaneously existing processes for this system.
#+P 2048000 +P 2048000
## Sets the maximum number of simultaneously existing ports for this system. ## Sets the maximum number of simultaneously existing ports for this system.
#+Q 1024000 +Q 1024000
## Sets the maximum number of ETS tables ## Sets the maximum number of ETS tables
#+e 256000 +e 256000
## Sets the maximum number of atoms the virtual machine can handle. ## Sets the maximum number of atoms the virtual machine can handle.
#+t 1048576 #+t 1048576
@ -26,7 +26,7 @@
## Set how many times generational garbages collections can be done without ## Set how many times generational garbages collections can be done without
## forcing a fullsweep collection. ## forcing a fullsweep collection.
#-env ERL_FULLSWEEP_AFTER 1000 -env ERL_FULLSWEEP_AFTER 1000
## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive
## (Disabled by default..use with caution!) ## (Disabled by default..use with caution!)
@ -43,7 +43,7 @@
## Specifies the net_kernel tick time in seconds. ## Specifies the net_kernel tick time in seconds.
## This is the approximate time a connected node may be unresponsive until ## This is the approximate time a connected node may be unresponsive until
## it is considered down and thereby disconnected. ## it is considered down and thereby disconnected.
#-kernel net_ticktime 60 -kernel net_ticktime 120
## Sets the distribution buffer busy limit (dist_buf_busy_limit). ## Sets the distribution buffer busy limit (dist_buf_busy_limit).
#+zdbbl 8192 #+zdbbl 8192
@ -98,3 +98,4 @@
## Specifies how long time (in milliseconds) to spend shutting down the system. ## Specifies how long time (in milliseconds) to spend shutting down the system.
## See: http://erlang.org/doc/man/erl.html ## See: http://erlang.org/doc/man/erl.html
#-shutdown_time 15000 #-shutdown_time 15000

View File

@ -242,16 +242,12 @@ end}.
%% @doc Erlang Process Limit %% @doc Erlang Process Limit
{mapping, "node.process_limit", "vm_args.+P", [ {mapping, "node.process_limit", "vm_args.+P", [
{datatype, integer}, {datatype, integer},
{default, 256000},
hidden hidden
]}. ]}.
%% Note: OTP R15 and earlier uses -env ERL_MAX_PORTS, R16+ uses +Q %% @doc The maximum number of concurrent ports/sockets.
%% @doc The number of concurrent ports/sockets
%% Valid range is 1024-134217727 %% Valid range is 1024-134217727
{mapping, "node.max_ports", {mapping, "node.max_ports", "vm_args.+Q", [
cuttlefish:otp("R16", "vm_args.+Q", "vm_args.-env ERL_MAX_PORTS"), [
{default, 262144},
{datatype, integer}, {datatype, integer},
{validators, ["range4ports"]} {validators, ["range4ports"]}
]}. ]}.
@ -319,7 +315,6 @@ end}.
%% @doc http://www.erlang.org/doc/man/kernel_app.html#net_ticktime %% @doc http://www.erlang.org/doc/man/kernel_app.html#net_ticktime
{mapping, "node.dist_net_ticktime", "vm_args.-kernel net_ticktime", [ {mapping, "node.dist_net_ticktime", "vm_args.-kernel net_ticktime", [
{commented, 60},
{datatype, integer}, {datatype, integer},
hidden hidden
]}. ]}.