diff options
| author | Emile Joubert <emile@rabbitmq.com> | 2011-08-23 16:17:36 +0100 |
|---|---|---|
| committer | Emile Joubert <emile@rabbitmq.com> | 2011-08-23 16:17:36 +0100 |
| commit | fbe1be958a0d034c139af0d8839d3f2149ac25cc (patch) | |
| tree | 227347c074ad7efd02066d4fce5545200b5f6204 | |
| parent | c3116e5b9ff0eddb8129e958f4f75c5b2f7fc9c0 (diff) | |
| download | rabbitmq-server-git-fbe1be958a0d034c139af0d8839d3f2149ac25cc.tar.gz | |
Cleaner docs, less verbose logging
| -rw-r--r-- | docs/rabbitmqctl.1.xml | 87 | ||||
| -rw-r--r-- | src/vm_memory_monitor.erl | 21 |
2 files changed, 49 insertions, 59 deletions
diff --git a/docs/rabbitmqctl.1.xml b/docs/rabbitmqctl.1.xml index 6e1144e9f9..b45e9df54e 100644 --- a/docs/rabbitmqctl.1.xml +++ b/docs/rabbitmqctl.1.xml @@ -382,44 +382,6 @@ </refsect2> <refsect2> - <title>Closing individual connections</title> - - <variablelist> - <varlistentry> - <term><cmdsynopsis><command>close_connection</command> <arg choice="req"><replaceable>connectionpid</replaceable></arg> <arg choice="req"><replaceable>explanation</replaceable></arg></cmdsynopsis></term> - <listitem> - <variablelist> - <varlistentry> - <term>connectionpid</term> - <listitem><para>Id of the Erlang process associated with the connection to close.</para></listitem> - </varlistentry> - <varlistentry> - <term>explanation</term> - <listitem><para>Explanation string.</para></listitem> - </varlistentry> - </variablelist> - <para> - Instruct the broker to close the connection associated - with the Erlang process id <option>connectionpid</option> (see also the - <link linkend="list_connections"><command>list_connections</command></link> - command), passing the <option>explanation</option> string to the - connected client as part of the AMQP connection shutdown - protocol. - </para> - <para role="example-prefix">For example:</para> - <screen role="example">rabbitmqctl close_connection "<rabbit@tanto.4262.0>" "go away"</screen> - <para role="example"> - This command instructs the RabbitMQ broker to close the - connection associated with the Erlang process - id <command><rabbit@tanto.4262.0></command>, passing the - explanation <command>go away</command> to the connected client. - </para> - </listitem> - </varlistentry> - </variablelist> - </refsect2> - - <refsect2> <title>User management</title> <para> Note that <command>rabbitmqctl</command> manages the RabbitMQ @@ -1347,9 +1309,40 @@ </refsect2> <refsect2> - <title>Message Tracing</title> + <title>Miscellaneous</title> <variablelist> <varlistentry> + <term><cmdsynopsis><command>close_connection</command> <arg choice="req"><replaceable>connectionpid</replaceable></arg> <arg choice="req"><replaceable>explanation</replaceable></arg></cmdsynopsis></term> + <listitem> + <variablelist> + <varlistentry> + <term>connectionpid</term> + <listitem><para>Id of the Erlang process associated with the connection to close.</para></listitem> + </varlistentry> + <varlistentry> + <term>explanation</term> + <listitem><para>Explanation string.</para></listitem> + </varlistentry> + </variablelist> + <para> + Instruct the broker to close the connection associated + with the Erlang process id <option>connectionpid</option> (see also the + <link linkend="list_connections"><command>list_connections</command></link> + command), passing the <option>explanation</option> string to the + connected client as part of the AMQP connection shutdown + protocol. + </para> + <para role="example-prefix">For example:</para> + <screen role="example">rabbitmqctl close_connection "<rabbit@tanto.4262.0>" "go away"</screen> + <para role="example"> + This command instructs the RabbitMQ broker to close the + connection associated with the Erlang process + id <command><rabbit@tanto.4262.0></command>, passing the + explanation <command>go away</command> to the connected client. + </para> + </listitem> + </varlistentry> + <varlistentry> <term><cmdsynopsis><command>trace_on</command> <arg choice="opt">-p <replaceable>vhost</replaceable></arg></cmdsynopsis></term> <listitem> <variablelist> @@ -1378,13 +1371,6 @@ </para> </listitem> </varlistentry> - </variablelist> - </refsect2> - - <refsect2> - <title>Memory Management</title> - <variablelist> - <varlistentry> <term><cmdsynopsis><command>set_vm_memory_high_watermark</command> <arg choice="req"><replaceable>fraction</replaceable></arg></cmdsynopsis></term> <listitem> @@ -1400,7 +1386,8 @@ 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. + 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 @@ -1408,13 +1395,9 @@ threshhold may change on systems with hot-swappable RAM when this command is executed without altering the fraction. </para> - <para> - The memory monitor polls memory usage every second. The memory monitor will - compare the memory in use with the updated threshhold after a second. - </para> <screen role="example">rabbitmqctl set_vm_memory_high_watermark 0.4</screen> <para role="example"> - This command sets the memory threshhold fraction to the default value of 40%. + This command sets the memory threshhold fraction to 40%. </para> </listitem> </varlistentry> diff --git a/src/vm_memory_monitor.erl b/src/vm_memory_monitor.erl index bc673c01b5..40fb7239bf 100644 --- a/src/vm_memory_monitor.erl +++ b/src/vm_memory_monitor.erl @@ -111,13 +111,13 @@ init([MemFraction]) -> State = #state { timeout = ?DEFAULT_MEMORY_CHECK_INTERVAL, timer = TRef, alarmed = false}, - {ok, internal_update(init_mem_state(State, MemFraction))}. + {ok, internal_update(set_mem_limits(State, MemFraction))}. handle_call(get_vm_memory_high_watermark, _From, State) -> {reply, State#state.memory_limit / State#state.total_memory, State}; handle_call({set_vm_memory_high_watermark, MemFraction}, _From, State) -> - State1 = init_mem_state(State, MemFraction), + 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]), @@ -155,14 +155,21 @@ code_change(_OldVsn, State, _Extra) -> %% Server Internals %%---------------------------------------------------------------------------- -init_mem_state(State, MemFraction) -> +set_mem_limits(State, MemFraction) -> TotalMemory = case get_total_memory() of unknown -> - error_logger:warning_msg( - "Unknown total memory size for your OS ~p. " - "Assuming memory size is ~pMB.~n", - [os:type(), trunc(?MEMORY_SIZE_FOR_UNKNOWN_OS/?ONE_MB)]), + case State of + #state { total_memory = undefined, + memory_limit = undefined } -> + error_logger:warning_msg( + "Unknown total memory size for your OS ~p. " + "Assuming memory size is ~pMB.~n", + [os:type(), + trunc(?MEMORY_SIZE_FOR_UNKNOWN_OS/?ONE_MB)]); + _ -> + ok + end, ?MEMORY_SIZE_FOR_UNKNOWN_OS; M -> M end, |
