summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Joubert <emile@rabbitmq.com>2011-08-26 17:45:16 +0100
committerEmile Joubert <emile@rabbitmq.com>2011-08-26 17:45:16 +0100
commit6f0cd44f24cf5ffe7923bfb96079c18e22f950ba (patch)
tree2f9a33e1630e4b31f15eb504f65ed6f606ff3df2
parent48dd8959c5ce549f9d844d816fba08a1fba41d62 (diff)
downloadrabbitmq-server-6f0cd44f24cf5ffe7923bfb96079c18e22f950ba.tar.gz
Move docs for rabbitmqctl set_vm_memory_high_watermark
and only modify state when necessary
-rw-r--r--docs/rabbitmqctl.1.xml22
-rw-r--r--src/vm_memory_monitor.erl5
2 files changed, 4 insertions, 23 deletions
diff --git a/docs/rabbitmqctl.1.xml b/docs/rabbitmqctl.1.xml
index b45e9df5..e5ec3eed 100644
--- a/docs/rabbitmqctl.1.xml
+++ b/docs/rabbitmqctl.1.xml
@@ -1377,28 +1377,10 @@
<variablelist>
<varlistentry>
<term>fraction</term>
- <listitem><para>The new memory threshhold fraction as a floating point number between
- 0.0 and 1.0 with a mandatory fractional part.</para></listitem>
+ <listitem><para>The new memory threshhold fraction at which flow control is triggered, as a
+ floating point number between 0.0 and 1.0 with a mandatory fractional part.</para></listitem>
</varlistentry>
</variablelist>
- <para>
- Sets the memory threshhold fraction at which memory-based flow control is
- triggered, until the broker restarts. The corresponding configuration
- setting should also be changed when the effects of this command should
- survive a broker restart. Use the <command>status</command> command to
- confirm the currently active memory threshhold. The command takes effect
- within the memory monitor polling interval.
- </para>
- <para>
- This command will update the memory threshhold as a fraction of the total RAM
- by querying the total RAM when the command is executed. Therefore the absolute
- threshhold may change on systems with hot-swappable RAM when this command is executed
- without altering the fraction.
- </para>
- <screen role="example">rabbitmqctl set_vm_memory_high_watermark 0.4</screen>
- <para role="example">
- This command sets the memory threshhold fraction to 40%.
- </para>
</listitem>
</varlistentry>
</variablelist>
diff --git a/src/vm_memory_monitor.erl b/src/vm_memory_monitor.erl
index 40fb7239..3b955914 100644
--- a/src/vm_memory_monitor.erl
+++ b/src/vm_memory_monitor.erl
@@ -118,10 +118,9 @@ handle_call(get_vm_memory_high_watermark, _From, State) ->
handle_call({set_vm_memory_high_watermark, MemFraction}, _From, State) ->
State1 = set_mem_limits(State, MemFraction),
- MemLimit = get_mem_limit(MemFraction, State1#state.total_memory),
error_logger:info_msg("Memory alarm changed to ~p, ~p bytes.~n",
- [MemFraction, MemLimit]),
- {reply, ok, State1#state{memory_limit = MemLimit}};
+ [MemFraction, State1#state.memory_limit]),
+ {reply, ok, State1};
handle_call(get_check_interval, _From, State) ->
{reply, State#state.timeout, State};