Skip to content

Commit

Permalink
Merge pull request #163 from basho/bugfix/vm-args-scl-false-20
Browse files Browse the repository at this point in the history
Add +scl and +sub support

Reviewed-by: seancribbs
  • Loading branch information
borshop committed Aug 13, 2014
2 parents 78b82b5 + 76e3ff2 commit b2ce0b1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
34 changes: 32 additions & 2 deletions priv/erlang_vm.schema
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions test/erlang_vm_schema_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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}
Expand All @@ -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),
Expand Down
14 changes: 13 additions & 1 deletion test/riak.schema
Original file line number Diff line number Diff line change
Expand Up @@ -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}
]}.

0 comments on commit b2ce0b1

Please sign in to comment.