Tuning the Erlang VM for the broker and edge (#3197)

* Tuning the Erlang VM for the broker and edge

* Remove +stbt and use +sbt instead
This commit is contained in:
Feng Lee 2020-01-17 15:47:13 +08:00 committed by GitHub
parent 9049c8de55
commit 4b8b5bfa2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 15 deletions

View File

@ -1,5 +1,5 @@
###################################################################### ######################################################################
## Erlang VM Args ## Erlang VM Args for EMQ X Broker
###################################################################### ######################################################################
## NOTE: ## NOTE:
@ -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 2097152
## 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 1048576
## Sets the maximum number of ETS tables ## Sets the maximum number of ETS tables
+e 256000 +e 262144
## 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
@ -61,11 +61,20 @@
## Sets the default binary virtual heap size of processes to the size Size. ## Sets the default binary virtual heap size of processes to the size Size.
#+hmbs 46422 #+hmbs 46422
## Sets the default maximum heap size of processes to the size Size.
## Defaults to 0, which means that no maximum heap size is used.
##For more information, see process_flag(max_heap_size, MaxHeapSize).
#+hmax 0
## Sets the default value for process flag message_queue_data. Defaults to on_heap.
#+hmqd on_heap | off_heap
## Sets the number of IO pollsets to use when polling for I/O. ## Sets the number of IO pollsets to use when polling for I/O.
#+IOp 1 #+IOp 1
## Sets the number of IO poll threads to use when polling for I/O. ## Sets the number of IO poll threads to use when polling for I/O.
#+IOt 1 ## Increase this for the busy systems with many concurrent connection.
+IOt 4
## Sets the number of scheduler threads to create and scheduler threads to set online. ## Sets the number of scheduler threads to create and scheduler threads to set online.
#+S 8:8 #+S 8:8
@ -74,7 +83,7 @@
#+SDcpu 8:8 #+SDcpu 8:8
## Sets the number of dirty I/O scheduler threads to create. ## Sets the number of dirty I/O scheduler threads to create.
#+SDio 10 +SDio 8
## Suggested stack size, in kilowords, for scheduler threads. ## Suggested stack size, in kilowords, for scheduler threads.
#+sss 32 #+sss 32
@ -95,7 +104,12 @@
## Sets the mapping of warning messages for error_logger ## Sets the mapping of warning messages for error_logger
#+W w #+W w
## Sets time warp mode: no_time_warp | single_time_warp | multi_time_warp
#+C no_time_warp
## Prevents loading information about source filenames and line numbers.
#+L
## 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

@ -1,6 +1,6 @@
############################## ######################################################################
# Erlang VM Args ## Erlang VM Args for EMQ X Edge
############################## ######################################################################
## NOTE: ## NOTE:
## ##
@ -10,8 +10,7 @@
## 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 20480 +P 16384
## Sets the maximum number of simultaneously existing ports for this system. ## Sets the maximum number of simultaneously existing ports for this system.
+Q 4096 +Q 4096
@ -19,7 +18,7 @@
+e 512 +e 512
## Sets the maximum number of atoms the virtual machine can handle. ## Sets the maximum number of atoms the virtual machine can handle.
+t 65536 +t 262144
## Set the location of crash dumps ## Set the location of crash dumps
-env ERL_CRASH_DUMP {{ platform_log_dir }}/crash.dump -env ERL_CRASH_DUMP {{ platform_log_dir }}/crash.dump
@ -30,7 +29,7 @@
## 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!)
#-heart -heart
## Specify the erlang distributed protocol. ## Specify the erlang distributed protocol.
## Can be one of: inet_tcp, inet6_tcp, inet_tls ## Can be one of: inet_tcp, inet6_tcp, inet_tls
@ -52,6 +51,7 @@
+spp false +spp false
## Sets the number of threads in async thread pool. Valid range is 0-1024. ## Sets the number of threads in async thread pool. Valid range is 0-1024.
## Increase the parameter if there are many simultaneous file I/O operations.
+A 1 +A 1
## Sets the default heap size of processes to the size Size. ## Sets the default heap size of processes to the size Size.
@ -60,6 +60,14 @@
## Sets the default binary virtual heap size of processes to the size Size. ## Sets the default binary virtual heap size of processes to the size Size.
#+hmbs 46422 #+hmbs 46422
## Sets the default maximum heap size of processes to the size Size.
## Defaults to 0, which means that no maximum heap size is used.
##For more information, see process_flag(max_heap_size, MaxHeapSize).
#+hmax 0
## Sets the default value for process flag message_queue_data. Defaults to on_heap.
#+hmqd on_heap | off_heap
## Sets the number of IO pollsets to use when polling for I/O. ## Sets the number of IO pollsets to use when polling for I/O.
+IOp 1 +IOp 1
@ -94,5 +102,13 @@
## Sets the mapping of warning messages for error_logger ## Sets the mapping of warning messages for error_logger
#+W w #+W w
#Prevents loading information about source filenames and line numbers. ## Sets time warp mode: no_time_warp | single_time_warp | multi_time_warp
#+C no_time_warp
## Prevents loading information about source filenames and line numbers.
+L +L
## Specifies how long time (in milliseconds) to spend shutting down the system.
## See: http://erlang.org/doc/man/erl.html
-shutdown_time 10000