The
Windows users probably wants to use the
As of ERTS version 5.9 (OTP-R15B) the runtime system will by
default not bind schedulers to logical processors.
For more information see documentation of the
Starts an Erlang runtime system.
The arguments can be divided into emulator flags, flags and plain arguments:
Any argument starting with the character
As indicated by the name, emulator flags controls the behavior of the emulator.
Any argument starting with the character
The
It can be noted that there are a small number of "-" flags which now actually are emulator flags, see the description below.
Plain arguments are not interpreted in any way. They are
also stored by the
Example:
% erl +W w -sname arnie +R 9 -s my_init -extra +bertie (arnie@host)1> init:get_argument(sname). {ok,[["arnie"]]} (arnie@host)2> init:get_plain_arguments(). ["+bertie"]
Here
% erl -myflag 1 1> init:get_argument(myflag). {ok,[["1"]]} 2> init:get_plain_arguments(). []
Here the user flag
In the following list, init flags are marked (init flag).
Unless otherwise specified, all other flags are user flags, for
which the values can be retrieved by calling
Everything following
Sets the application configuration parameter
Command line arguments are read from the file
The file
The
The initial Erlang shell does not read user input until the system boot procedure has been completed (Erlang 5.4 and later). This flag disables the start synchronization feature and lets the shell start in parallel with the rest of the system.
Specifies the name of the boot file,
Defaults to
If the boot script contains a path variable
Enables the code path cache of the code server, see
Compiles the specified modules and then terminates (with
non-zero exit code if the compilation of some file did not
succeed). Implies
Specifies the name of a configuration file,
If this flag is present,
Obsolete flag without any effect and common misspelling for
Starts the Erlang runtime system detached from the system
console. Useful for running daemons and backgrounds processes. Implies
Useful for debugging. Prints out the actual arguments sent to the emulator.
Sets the host OS environment variable
% erl -env DISPLAY gin:0
In this example, an Erlang runtime system is started with
the
Makes
Everything following
Starts heart beat monitoring of the Erlang runtime system.
See
Starts the Erlang runtime system as a hidden node, if it is
run as a distributed node. Hidden nodes always establish
hidden connections to all other nodes except for nodes in the
same global group. Hidden connections are not published on
either of the connected nodes, i.e. neither of the connected
nodes are part of the result from
Specifies the IP addresses for the hosts on which Erlang
boot servers are running, see
The IP addresses must be given in the standard form (four
decimal numbers separated by periods, for example
Specifies the identity of the Erlang runtime system. If it is
run as a distributed node,
Makes
Selects an instrumented Erlang runtime system (virtual
machine) to run, instead of the ordinary one. When running an
instrumented runtime system, some resource usage data can be
obtained and analysed using the module
Specifies the method used by
Makes the Erlang runtime system invoke
Displays the manual page for the Erlang module
Indicates if the system should load code dynamically
(
Makes the Erlang runtime system into a distributed node.
This flag invokes all network servers necessary for a node to
become distributed. See
The name of the node will be
Ensures that the Erlang runtime system never tries to read
any input. Implies
Starts an Erlang runtime system with no shell. This flag makes it possible to have the Erlang runtime system as a component in a series of UNIX pipes.
Disables the sticky directory facility of the Erlang code
server, see
Invokes the old Erlang shell from Erlang 3.3. The old shell can still be used.
Adds the specified directories to the beginning of the code
path, similar to
Adds the specified directories to the end of the code path,
similar to
Starts Erlang with a remote shell connected to
Specifies an alternative to
Makes
Makes
Sets the magic cookie of the node to
Specifies how long time (in milliseconds) the
Makes the Erlang runtime system into a distributed node,
similar to
This is sometimes the only way to run distributed Erlang if
the DNS (Domain Name System) is not running. There can be no
communication between nodes running with the
NOTE: The runtime system with SMP support will not
be available on all supported platforms. See also the
Makes the emulator print out its version number. The same
as
Suggested stack size, in kilowords, for threads in the
async-thread pool. Valid range is 16-8192 kilowords. The
default suggested stack size is 16 kilowords, i.e, 64
kilobyte on 32-bit architectures. This small default size
has been chosen since the amount of async-threads might
be quite large. The default size is enough for drivers
delivered with Erlang/OTP, but might not be sufficiently
large for other dynamically linked in drivers that use the
Sets the number of threads in async thread pool, valid range is 0-1024. If thread support is available, the default is 10.
The
If the
Note that on Windows, this flag is only applicable for
Disable compensation for sudden changes of system time.
Normally,
When the
If the emulator detects an internal error (or runs out of memory), it will by default generate both a crash dump and a core dump. The core dump will, however, not be very useful since the content of process heaps is destroyed by the crash dump generation.
The
Calling
Set max number of ETS tables.
Force the
The VM works with file names as if they are encoded using the ISO-latin-1 encoding, disallowing Unicode characters with codepoints beyond 255. This is default on operating systems that have transparent file naming, i.e. all Unixes except MacOSX.
See
The VM works with file names as if they are encoded using UTF-8 (or some other system specific Unicode encoding). This is the default on operating systems that enforce Unicode encoding, i.e. Windows and MacOSX.
The
See
Selection between
The
See
Sets the default heap size of processes to the size
Sets the default binary virtual heap size of processes to the size
Enables or disables the kernel poll functionality if
the emulator supports it. Default is
Enables auto load tracing, displaying info while loading code.
Don't load information about source file names and line numbers. This will save some memory, but exceptions will not contain information about the file names and line numbers.
Memory allocator specific flags, see
Control behavior of signals to ports.
As of OTP-R16 signals to ports are truly asynchronously
delivered. Note that signals always have been documented as
asynchronous. The underlying implementation has, however,
previously delivered these signals synchronously. Correctly
written Erlang programs should be able to handle this without
any issues. Bugs in existing Erlang programs that make false
assumptions about signals to ports may, however, be tricky to
find. This switch has been introduced in order to at least
make it easier to compare behaviors during a transition period.
Note that this flag is deprecated as of its
introduction, and is scheduled for removal in OTP-R17.
Sets the range of characters that the system will consider printable in heuristic detection of strings. This typically affects the shell, debugger and io:format functions (when ~tp is used in the format string).
Currently two values for the
Se also
Sets the maximum number of simultaneously existing processes for this
system if a
NOTE: The actual maximum chosen may be much larger than
the
The default value is
If
Sets the maximum number of simultaneously existing ports for this
system if a Number is passed as value. Valid range for
NOTE: The actual maximum chosen may be much larger than
the actual
The default value used is normally
On Windows the default value is set to
Previously the environment variable
If
Sets the compatibility mode.
The distribution mechanism is not backwards compatible by
default. This flags sets the emulator in compatibility mode
with an earlier Erlang/OTP release
Note: Make sure all nodes (Erlang-, C-, and Java nodes) of a distributed Erlang system is of the same Erlang/OTP release, or from two different Erlang/OTP releases X and Y, where all Y nodes have compatibility mode X.
Force ets memory block to be moved on realloc.
Limits the amount of reader groups used by read/write locks optimized for read operations in the Erlang runtime system. By default the reader groups limit equals 64.
When the amount of schedulers is less than or equal to the reader
groups limit, each scheduler has its own reader group. When the
amount of schedulers is larger than the reader groups limit,
schedulers share reader groups. Shared reader groups degrades
read lock and read unlock performance while a large amount of
reader groups degrades write lock performance, so the limit is a
tradeoff between performance for read operations and performance
for write operations. Each reader group currently consumes 64 byte
in each read/write lock. Also note that a runtime system using
shared reader groups benefits from
Sets the amount of scheduler threads to create and scheduler
threads to set online when SMP support has been enabled.
Valid range for both values are 1-1024. If the
Erlang runtime system is able to determine the amount
of logical processors configured and logical processors available,
This flag will be ignored if the emulator doesn't have
SMP support enabled (see the
Scheduling specific flags.
Set scheduler bind type.
Schedulers can also be bound using the
If any of these errors occur when
Currently valid
Binding of schedulers is currently only supported on newer Linux, Solaris, FreeBSD, and Windows systems.
If no CPU topology is available when the
The runtime system will by default not bind schedulers to logical processors.
NOTE: If the Erlang runtime system is the only operating system process that binds threads to logical processors, this improves the performance of the runtime system. However, if other operating system processes (as for example another Erlang runtime system) also bind threads to logical processors, there might be a performance penalty instead. In some cases this performance penalty might be severe. If this is the case, you are advised to not bind the schedulers.
How schedulers are bound matters. For example, in situations when there are fewer running processes than schedulers online, the runtime system tries to migrate processes to schedulers with low scheduler identifiers. The more the schedulers are spread over the hardware, the more resources will be available to the runtime system in such situations.
NOTE: If a scheduler fails to bind, this
will often be silently ignored. This since it isn't always
possible to verify valid logical processor identifiers. If
an error is reported, it will be reported to the
Set scheduler busy wait threshold. Default is
NOTE: This flag may be removed or changed at any time without prior notice.
Enable or disable scheduler compaction of load. By default scheduler compaction of load is enabled. When enabled, load balancing will strive for a load distribution which causes as many scheduler threads as possible to be fully loaded (i.e., not run out of work). This is accomplished by migrating load (e.g. runnable processes) into a smaller set of schedulers when schedulers frequently run out of work. When disabled, the frequency with which schedulers run out of work will not be taken into account by the load balancing logic.
Set a user defined CPU topology. The user defined
CPU topology will override any automatically detected
CPU topology. The CPU topology is used when
Upper-case letters signify real identifiers and lower-case
letters signify fake identifiers only used for description
of the topology. Identifiers passed as real identifiers may
be used by the runtime system when trying to access specific
hardware and if they are not correct the behavior is
undefined. Faked logical CPU identifiers are not accepted
since there is no point in defining the CPU topology without
real logical CPU identifiers. Thread, core, processor, and
node identifiers may be left out. If left out, thread id
defaults to
Both increasing and decreasing
NUMA node identifiers are system wide. That is, each NUMA node on the system have to have a unique identifier. Processor identifiers are also system wide. Core identifiers are processor wide. Thread identifiers are core wide.
The order of the identifier types imply the hierarchy of the
CPU topology. Valid orders are either
If a list of identifiers is used in an
A simple example. A single quad core processor may be described this way:
% erl +sct L0-3c0-3 1> erlang:system_info(cpu_topology). [{processor,[{core,{logical,0}}, {core,{logical,1}}, {core,{logical,2}}, {core,{logical,3}}]}]
A little more complicated example. Two quad core processors. Each processor in its own NUMA node. The ordering of logical processors is a little weird. This in order to give a better example of identifier lists:
% erl +sct L0-1,3-2c0-3p0N0:L7,4,6-5c0-3p1N1 1> erlang:system_info(cpu_topology). [{node,[{processor,[{core,{logical,0}}, {core,{logical,1}}, {core,{logical,3}}, {core,{logical,2}}]}]}, {node,[{processor,[{core,{logical,7}}, {core,{logical,4}}, {core,{logical,6}}, {core,{logical,5}}]}]}]
As long as real identifiers are correct it is okay to pass a CPU topology that is not a correct description of the CPU topology. When used with care this can actually be very useful. This in order to trick the emulator to bind its schedulers as you want. For example, if you want to run multiple Erlang runtime systems on the same machine, you want to reduce the amount of schedulers used and manipulate the CPU topology so that they bind to different logical CPUs. An example, with two Erlang runtime systems on a quad core machine:
% erl +sct L0-3c0-3 +sbt db +S3:2 -detached -noinput -noshell -sname one % erl +sct L3-0c0-3 +sbt db +S3:2 -detached -noinput -noshell -sname two
In this example each runtime system have two schedulers each online, and all schedulers online will run on different cores. If we change to one scheduler online on one runtime system, and three schedulers online on the other, all schedulers online will still run on different cores.
Note that a faked CPU topology that does not reflect how the real CPU topology looks like is likely to decrease the performance of the runtime system.
For more information, see
Try to set scheduler bind type. The same as the
Set scheduler wake cleanup threshold. Default is
NOTE: This flag may be removed or changed at any time without prior notice.
Set scheduler wakeup strategy. Default strategy changed in erts-5.10/OTP-R16A. This strategy was previously known as
NOTE: This flag may be removed or changed at any time without prior notice.
Set scheduler wakeup threshold. Default is
NOTE: This flag may be removed or changed at any time without prior notice.
Set default scheduler hint for port parallelism. If set to
Suggested stack size, in kilowords, for scheduler threads. Valid range is 4-8192 kilowords. The default stack size is OS dependent.
Set the maximum number of atoms the VM can handle. Default is 1048576.
Enables modified timing and sets the modified timing level. Currently valid range is 0-9. The timing of the runtime system will change. A high level usually means a greater change than a low level. Changing the timing can be very useful for finding timing related bugs.
Currently, modified timing affects the following:
A process calling
NOTE: Performance will suffer when modified timing
is enabled. This flag is only intended for testing and
debugging. Also note that
Makes the emulator print out its version number.
Verbose.
Sets the mapping of warning messages for
Miscellaneous flags.
Set the distribution buffer busy limit
(
A larger buffer limit will allow processes to buffer more outgoing messages over the distribution. When the buffer limit has been reached, sending processes will be suspended until the buffer size has shrunk. The buffer limit is per distribution channel. A higher limit will give lower latency and higher throughput at the expense of higher memory usage.
If the emulator needs to write a crash dump, the value of this
variable will be the file name of the crash dump file.
If the variable is not set, the name of the crash dump file will
be
Unix systems: If the emulator needs to write a crash dump, it will use the value of this variable to set the nice value for the process, thus lowering its priority. The allowable range is 1 through 39 (higher values will be replaced with 39). The highest value, 39, will give the process the lowest priority.
Unix systems: This variable gives the number of seconds that the emulator will be allowed to spend writing a crash dump. When the given number of seconds have elapsed, the emulator will be terminated by a SIGALRM signal.
If the environment variable is not set or it is set to zero seconds,
If the environment variable is set to negative valie, e.g.
This environment variable is used in conjuction with
Suppresses the writing a crash dump file entirely, thus rebooting the runtime system immediately. This is the same as not setting the environment variable.
Setting the environment variable to a negative value will cause the termination of the runtime system to wait until the crash dump file has been completly written.
Will wait for
The content of this environment variable will be added to the
beginning of the command line for
The
The content of these environment variables will be added to the
end of the command line for
The
This environment variable contains a list of additional library
directories that the code server will search for applications and
add to the code path.
See
This environment variable may be set to a comma-separated
list of IP addresses, in which case the
This environment variable can contain the port number to use when
communicating with
The standard Erlang/OTP system can be re-configured to change the default behavior on start-up.
When Erlang/OTP is started, the system searches for a file named .erlang in the directory where Erlang/OTP is started. If not found, the user's home directory is searched for an .erlang file.
If an .erlang file is found, it is assumed to contain valid Erlang expressions. These expressions are evaluated as if they were input to the shell.
A typical .erlang file contains a set of search paths, for example:
Functions in the shell which are not prefixed by a module name are assumed to be functional objects (Funs), built-in functions (BIFs), or belong to the module user_default or shell_default.
To include private shell commands, define them in a module user_default and add the following argument as the first line in the .erlang file.
If the contents of .erlang are changed and a private version of
user_default is defined, it is possible to customize the Erlang/OTP environment.
More powerful changes can be made by supplying command line arguments in the
start-up script erl. Refer to erl(1) and