summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/rabbitmq.config.example5
-rw-r--r--ebin/rabbit_app.in1
-rw-r--r--src/rabbit_memory_monitor.erl4
3 files changed, 8 insertions, 2 deletions
diff --git a/docs/rabbitmq.config.example b/docs/rabbitmq.config.example
index 3047f8f70e..f4fe3b9ec4 100644
--- a/docs/rabbitmq.config.example
+++ b/docs/rabbitmq.config.example
@@ -200,6 +200,11 @@
%%
%% {vm_memory_high_watermark_paging_ratio, 0.5},
+ %% Interval (in milliseconds) at which we perform the check of the memory
+ %% levels against the watermarks.
+ %%
+ %% {memory_monitor_interval, 2500}
+
%% Set disk free limit (in bytes). Once free disk space reaches this
%% lower bound, a disk alarm will be set - see the documentation
%% listed above for more details.
diff --git a/ebin/rabbit_app.in b/ebin/rabbit_app.in
index 3510474527..92c9c2983d 100644
--- a/ebin/rabbit_app.in
+++ b/ebin/rabbit_app.in
@@ -19,6 +19,7 @@
{ssl_options, []},
{vm_memory_high_watermark, 0.4},
{vm_memory_high_watermark_paging_ratio, 0.5},
+ {memory_monitor_interval, 2500},
{disk_free_limit, 50000000}, %% 50MB
{msg_store_index_module, rabbit_msg_store_ets_index},
{backing_queue_module, rabbit_variable_queue},
diff --git a/src/rabbit_memory_monitor.erl b/src/rabbit_memory_monitor.erl
index 7aa29fc423..24b3ae9af4 100644
--- a/src/rabbit_memory_monitor.erl
+++ b/src/rabbit_memory_monitor.erl
@@ -41,7 +41,6 @@
}).
-define(SERVER, ?MODULE).
--define(DEFAULT_UPDATE_INTERVAL, 2500).
-define(TABLE_NAME, ?MODULE).
%% If all queues are pushed to disk (duration 0), then the sum of
@@ -110,7 +109,8 @@ memory_use(ratio) ->
%%----------------------------------------------------------------------------
init([]) ->
- {ok, TRef} = timer:send_interval(?DEFAULT_UPDATE_INTERVAL, update),
+ {ok, Interval} = application:get_env(rabbit, memory_monitor_interval),
+ {ok, TRef} = timer:send_interval(Interval, update),
Ets = ets:new(?TABLE_NAME, [set, private, {keypos, #process.pid}]),
Alarms = rabbit_alarm:register(self(), {?MODULE, conserve_resources, []}),