Skip to content

Commit

Permalink
Merge pull request rabbitmq#891 from rabbitmq/rabbitmq-server-500-squ…
Browse files Browse the repository at this point in the history
…ashed

Keep track of connections, introduce per-vhost limits
  • Loading branch information
michaelklishin authored Aug 26, 2016
2 parents 3001810 + a660b70 commit 6d9d506
Show file tree
Hide file tree
Showing 15 changed files with 1,658 additions and 11 deletions.
55 changes: 52 additions & 3 deletions docs/rabbitmqctl.1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,55 @@
</variablelist>
</refsect2>

<refsect2>
<title>Virtual Host Limits</title>
<para>
It is possible to enforce certain limits on virtual hosts.
</para>
<variablelist>
<varlistentry>
<term><cmdsynopsis><command>set_vhost_limits</command> <arg choice="opt">-p <replaceable>vhostpath</replaceable></arg> <arg choice="req"><replaceable>definition</replaceable></arg></cmdsynopsis></term>
<listitem>
<para>
Sets virtual host limits
</para>
<variablelist>
<varlistentry>
<term>definition</term>
<listitem><para>
The definition of the limits, as a
JSON term. In most shells you are very likely to
need to quote this.

Recognised limits: max-connections (0 means "no limit").
</para></listitem>
</varlistentry>
</variablelist>
<para role="example-prefix">For example:</para>
<screen role="example">rabbitmqctl set_vhost_limits -p qa_env '{"max-connections": 1024}'</screen>
<para role="example">
This command limits the max number of concurrent connections in vhost <command>qa_env</command>
to 1024.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><cmdsynopsis><command>clear_vhost_limits</command> <arg choice="opt">-p <replaceable>vhostpath</replaceable></arg></cmdsynopsis></term>
<listitem>
<para>
Clears virtual host limits
</para>
<para role="example-prefix">For example:</para>
<screen role="example">rabbitmqctl clear_vhost_limits -p qa_env</screen>
<para role="example">
This command clears vhost limits in vhost <command>qa_env</command>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>

<refsect2>
<title>Server Status</title>
<para>
Expand Down Expand Up @@ -2069,9 +2118,9 @@
<varlistentry>
<term>fraction</term>
<listitem><para>
Limit relative to the total amount available RAM
as a non-negative floating point number.
Values lower than 1.0 can be dangerous and
Limit relative to the total amount available RAM
as a non-negative floating point number.
Values lower than 1.0 can be dangerous and
should be used carefully.
</para></listitem>
</varlistentry>
Expand Down
1 change: 0 additions & 1 deletion include/rabbit_cli.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
-define(ONLINE_OPT, "--online").
-define(LOCAL_OPT, "--local").


-define(NODE_DEF(Node), {?NODE_OPT, {option, Node}}).
-define(QUIET_DEF, {?QUIET_OPT, flag}).
-define(VHOST_DEF, {?VHOST_OPT, {option, "/"}}).
Expand Down
5 changes: 5 additions & 0 deletions src/rabbit.erl
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@
{mfa, {rabbit_direct, boot, []}},
{requires, log_relay}]}).

-rabbit_boot_step({connection_tracking,
[{description, "sets up internal storage for node-local connections"},
{mfa, {rabbit_connection_tracking, boot, []}},
{requires, log_relay}]}).

-rabbit_boot_step({networking,
[{mfa, {rabbit_networking, boot, []}},
{requires, log_relay}]}).
Expand Down
Loading

0 comments on commit 6d9d506

Please sign in to comment.