diff --git a/priv/erlang_vm.schema b/priv/erlang_vm.schema index 41fcd222..af46e3a5 100644 --- a/priv/erlang_vm.schema +++ b/priv/erlang_vm.schema @@ -218,8 +218,38 @@ %% More information: http://www.erlang.org/doc/man/erl.html#+sfwi {mapping, "erlang.schedulers.force_wakeup_interval", "vm_args.+sfwi", [ {commented, 500}, - {datatype, integer}, - hidden + {datatype, integer} +]}. + +%% @doc 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. +%% +%% More information: http://www.erlang.org/doc/man/erl.html#+scl +{mapping, "erlang.schedulers.compaction_of_load", "vm_args.+scl", [ + {commented, "false"}, + {datatype, {enum, [true, false]}} +]}. + +%% @doc Enable or disable scheduler utilization balancing of load. By +%% default scheduler utilization balancing is disabled and instead +%% scheduler compaction of load is enabled which 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). When +%% scheduler utilization balancing is enabled the system will instead +%% try to balance scheduler utilization between schedulers. That is, +%% strive for equal scheduler utilization on all schedulers. +%% +%% More information: http://www.erlang.org/doc/man/erl.html#+sub +{mapping, "erlang.schedulers.utilization_balancing", "vm_args.+sub", [ + {commented, "true"}, + {datatype, {enum, [true, false]}} ]}. %% @doc For ease of firewall configuration, the Erlang distribution diff --git a/test/erlang_vm_schema_tests.erl b/test/erlang_vm_schema_tests.erl index dd615e68..4835269c 100644 --- a/test/erlang_vm_schema_tests.erl +++ b/test/erlang_vm_schema_tests.erl @@ -23,6 +23,8 @@ basic_schema_test() -> cuttlefish_unit:assert_config(Config, "vm_args.+P", 256000), cuttlefish_unit:assert_not_configured(Config, "vm_args.+zdbbl"), cuttlefish_unit:assert_not_configured(Config, "vm_args.+sfwi"), + cuttlefish_unit:assert_not_configured(Config, "vm_args.+scl"), + cuttlefish_unit:assert_not_configured(Config, "vm_args.+sub"), cuttlefish_unit:assert_not_configured(Config, "vm_args.-kernel net_ticktime"), cuttlefish_unit:assert_not_configured(Config, "kernel.inet_dist_listen_min"), cuttlefish_unit:assert_not_configured(Config, "kernel.inet_dist_listen_max"), @@ -55,6 +57,8 @@ override_schema_test() -> {["erlang", "process_limit"], 128001}, {["erlang", "distribution_buffer_size"], 1024}, {["erlang", "schedulers", "force_wakeup_interval"], 500}, + {["erlang", "schedulers", "compaction_of_load"], true}, + {["erlang", "schedulers", "utilization_balancing"], false}, {["erlang", "distribution", "port_range", "minimum"], 6000}, {["erlang", "distribution", "port_range", "maximum"], 7999}, {["erlang", "distribution", "net_ticktime"], 43} @@ -75,6 +79,8 @@ override_schema_test() -> cuttlefish_unit:assert_config(Config, "vm_args.+P", 128001), cuttlefish_unit:assert_config(Config, "vm_args.+zdbbl", 1), cuttlefish_unit:assert_config(Config, "vm_args.+sfwi", 500), + cuttlefish_unit:assert_config(Config, "vm_args.+scl", true), + cuttlefish_unit:assert_config(Config, "vm_args.+sub", false), cuttlefish_unit:assert_config(Config, "kernel.inet_dist_listen_min", 6000), cuttlefish_unit:assert_config(Config, "kernel.inet_dist_listen_max", 7999), cuttlefish_unit:assert_config(Config, "vm_args.-kernel net_ticktime", 43), diff --git a/test/riak.schema b/test/riak.schema index fb94f6ea..34066636 100644 --- a/test/riak.schema +++ b/test/riak.schema @@ -1195,8 +1195,20 @@ end}. %% @doc Erlang VM scheduler tuning. %% Prerequisite: a patched VM from Basho, or a VM compiled separately -%% with this patch applied: +%% with this patch applied (R15B only): %% https://gist.github.com/evanmcc/a599f4c6374338ed672e {mapping, "erlang.swiffy", "vm_args.+sfwi", [ {commented, "500"} ]}. + +{mapping, "erlang.scl", "vm_args.+scl", [ + {commented, "false"}, + {datatype, {enum, [true, false]}}, + {level, advanced} +]}. + +{mapping, "erlang.sub", "vm_args.+sub", [ + {commented, "true"}, + {datatype, {enum, [true, false]}}, + {level, advanced} +]}.