Skip to content

Update cuttlefish schema for rabbitmq/rabbitmq-common#224 changes #1394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define PROJECT_ENV
{ssl_options, []},
{vm_memory_high_watermark, 0.4},
{vm_memory_high_watermark_paging_ratio, 0.5},
{vm_memory_calculation_strategy, rss},
{vm_memory_calculation_strategy, allocated},
{memory_monitor_interval, 2500},
{disk_free_limit, 50000000}, %% 50MB
{msg_store_index_module, rabbit_msg_store_ets_index},
Expand Down
8 changes: 4 additions & 4 deletions docs/rabbitmq.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@
##
# vm_memory_high_watermark_paging_ratio = 0.5

## Selects Erlang VM memory consumption calculation strategy. Can be `rss` or `erlang`,
## `rss` is the default. Introduced in 3.6.11.
## See https://github.com/rabbitmq/rabbitmq-server/issues/1223 for background.
# vm_memory_calculation_strategy = rss
## Selects Erlang VM memory consumption calculation strategy. Can be `allocated`, `rss` or `legacy` (aliased as `erlang`),
## Introduced in 3.6.11. `allocated` is the default as of 3.6.13.
## See https://github.com/rabbitmq/rabbitmq-server/issues/1223 and rabbitmq/rabbitmq-common#224 for background.
# vm_memory_calculation_strategy = allocated

## Interval (in milliseconds) at which we perform the check of the memory
## levels against the watermarks.
Expand Down
8 changes: 4 additions & 4 deletions docs/rabbitmq.config.example
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@
%%
%% {vm_memory_high_watermark_paging_ratio, 0.5},

%% Selects Erlang VM memory consumption calculation strategy. Can be `rss` or `erlang`,
%% `rss` is the default. Introduced in 3.6.11.
%% See https://github.com/rabbitmq/rabbitmq-server/issues/1223 for background.
%% {vm_memory_calculation_strategy, rss},
%% Selects Erlang VM memory consumption calculation strategy. Can be `allocated`, `rss` or `legacy` (aliased as `erlang`),
%% Introduced in 3.6.11. `allocated` is the default as of 3.6.13.
%% See https://github.com/rabbitmq/rabbitmq-server/issues/1223 and rabbitmq/rabbitmq-common#224 for background.
%% {vm_memory_calculation_strategy, allocated},

%% Interval (in milliseconds) at which we perform the check of the memory
%% levels against the watermarks.
Expand Down
8 changes: 4 additions & 4 deletions priv/schema/rabbit.schema
Original file line number Diff line number Diff line change
Expand Up @@ -686,13 +686,13 @@ end}.
{mapping, "memory_monitor_interval", "rabbit.memory_monitor_interval",
[{datatype, integer}]}.

%% When set to rss, RabbitMQ will display the memory usage as reported
%% by the operating system (RSS value), not by the Erlang VM.
%% Selects Erlang VM memory consumption calculation strategy.
%% Can be `allocated`, `rss` or `legacy` (aliased as `erlang`).
%%
%% {vm_memory_calculation_strategy, rss},
%% {vm_memory_calculation_strategy, allocated},

{mapping, "vm_memory_calculation_strategy", "rabbit.vm_memory_calculation_strategy",
[{datatype, {enum, [rss, erlang]}}]}.
[{datatype, {enum, [rss, erlang, allocated, legacy]}}]}.

%% Set disk free limit (in bytes). Once free disk space reaches this
%% lower bound, a disk alarm will be set - see the documentation
Expand Down
20 changes: 15 additions & 5 deletions src/rabbit_looking_glass.erl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
-module(rabbit_looking_glass).

-ignore_xref([{lg, trace, 4}]).
-ignore_xref([{maps, from_list, 1}]).

-export([boot/0]).
-export([connections/0]).
Expand All @@ -27,12 +28,21 @@ boot() ->
ok;
Value ->
Input = parse_value(Value),
rabbit_log:info("Enabling Looking Glass profiler, input value: ~p", [Input]),
rabbit_log:info(
"Enabling Looking Glass profiler, input value: ~p",
[Input]
),
{ok, _} = application:ensure_all_started(looking_glass),
lg:trace(Input, lg_file_tracer, "traces.lz4", #{
mode => profile,
running => true,
send => true})
lg:trace(
Input,
lg_file_tracer,
"traces.lz4",
maps:from_list([
{mode, profile},
{running, true},
{send, true}]
)
)
end.

parse_value(Value) ->
Expand Down
8 changes: 8 additions & 0 deletions test/config_schema_SUITE_data/rabbit.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ tcp_listen_options.exit_on_close = false",
[{rabbit,
[{vm_memory_calculation_strategy, erlang}]}],
[]},
{vm_memory_calculation_strategy, "vm_memory_calculation_strategy = allocated",
[{rabbit,
[{vm_memory_calculation_strategy, allocated}]}],
[]},
{vm_memory_calculation_strategy, "vm_memory_calculation_strategy = legacy",
[{rabbit,
[{vm_memory_calculation_strategy, legacy}]}],
[]},
{listeners_tcp_ip,
"listeners.tcp.1 = 192.168.1.99:5672",
[{rabbit,[{tcp_listeners,[{"192.168.1.99",5672}]}]}],
Expand Down