📎 Webclip
Erlang VM Tuning
Riak runs on Erlang VM, so tuning VM parameters is part of performance optimization. The page maps Erlang flags and environment values to Riak configuration names, then explains which settings affect multiprocessing, scheduler behavior, port usage, buffering, storage limits, crash dumps, network tick checks, and shutdown timing.
Reading notes#
- Riak is written almost entirely in Erlang and exposes only a subset of Erlang VM parameters through node configuration files.
- In Riak versions before 2.0, VM parameters were set in
vm.args; in 2.0 and later, they are set inriak.conf, andvm.argsvalues overrideriak.confwhen both are present. - SMP can be enabled, disabled, or set to
auto;autoenables it only when the OS supports SMP and more than one logical processor is detected. - The scheduler settings include total and online thread counts, wakeup interval, compaction of load, and utilization balancing.
+sfwiis recommended at500and+sclatfalsewhen using the oldervm.argssystem.- Only one of compaction of load or utilization balancing can be active at a time; if both are false, Riak uses compaction of load.
- Port settings cover the Erlang distribution port range, the maximum number of concurrent ports or sockets, and the
nodenameused for cluster node identifiers. - The asynchronous thread pool can be sized with
erlang.async_threads, and each async thread has a configurable stack size. - Kernel polling is on by default and can be turned off with
erlang.K = off. - Warning messages from
error_loggercan be mapped to warnings, errors, or info reports witherlang.W. erlang.process_limitsets the maximum number of system processes, anderlang.distribution_buffer_sizecontrols the distribution buffer busy limit.erlang.max_ets_tablessets the ETS table limit, and higher values increase quick-access storage at the cost of RAM.erlang.crash_dumpchanges the crash dump location, anderlang.distribution.net_ticktimesets the interval for node liveness checks.erlang.shutdown_timesets how long the VM spends shutting down before killing existing processes.
