summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2017-10-20 21:25:29 +0300
committerMichael Klishin <michael@clojurewerkz.org>2017-10-20 21:25:29 +0300
commit88485d9d9e5586394fe3bb162181c0e723152a53 (patch)
tree0e088b9ea4ff2158874a1cf82d6cad67a09d2db9
parent1409ce20c40bfeeb3d82065119a2caf5f9b7e54e (diff)
parent7db615949f34162f9b283b63cae528cd25d21317 (diff)
downloadrabbitmq-server-git-88485d9d9e5586394fe3bb162181c0e723152a53.tar.gz
Merge branch 'cloudamqp-max_connections' into stable
-rw-r--r--Makefile1
-rw-r--r--docs/rabbitmq.config.example19
-rw-r--r--src/tcp_listener_sup.erl3
3 files changed, 22 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f97021920c..5b26d4ec3b 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,7 @@ define PROJECT_ENV
%% breaks the QPid Java client
{frame_max, 131072},
{channel_max, 0},
+ {connection_max, infinity},
{heartbeat, 60},
{msg_store_file_size_limit, 16777216},
{fhc_write_buffering, true},
diff --git a/docs/rabbitmq.config.example b/docs/rabbitmq.config.example
index fe0f7b04cd..990ffccc09 100644
--- a/docs/rabbitmq.config.example
+++ b/docs/rabbitmq.config.example
@@ -218,6 +218,25 @@
%%
%% {channel_max, 0},
+ %% Set the max permissible number of client connections to the node.
+ %% `infinity` means "no limit".
+ %%
+ %% This limit applies to client connections to all listeners (regardless of
+ %% the protocol, whether TLS is used and so on). CLI tools and inter-node
+ %% connections are exempt.
+ %%
+ %% When client connections are rapidly opened in succession, it is possible
+ %% for the total connection count to go slightly higher than the configured limit.
+ %% The limit works well as a general safety measure.
+ %%
+ %% Clients that are hitting the limit will see their TCP connections fail or time out.
+ %%
+ %% Introduced in 3.6.13.
+ %%
+ %% Related doc guide: http://www.rabbitmq.com/networking.html.
+ %%
+ %% {connection_max, infinity},
+
%% TCP socket options.
%%
%% Related doc guide: http://www.rabbitmq.com/networking.html.
diff --git a/src/tcp_listener_sup.erl b/src/tcp_listener_sup.erl
index 14654535d6..7cb1214c8e 100644
--- a/src/tcp_listener_sup.erl
+++ b/src/tcp_listener_sup.erl
@@ -49,10 +49,11 @@ start_link(IPAddress, Port, Transport, SocketOpts, ProtoSup, ProtoOpts, OnStartu
init({IPAddress, Port, Transport, SocketOpts, ProtoSup, ProtoOpts, OnStartup, OnShutdown,
ConcurrentAcceptorCount, Label}) ->
{ok, AckTimeout} = application:get_env(rabbit, ssl_handshake_timeout),
+ MaxConnections = rabbit_misc:get_env(rabbit, connection_max, infinity),
{ok, {{one_for_all, 10, 10}, [
ranch:child_spec({acceptor, IPAddress, Port}, ConcurrentAcceptorCount,
Transport, [{port, Port}, {ip, IPAddress},
- {max_connections, infinity},
+ {max_connections, MaxConnections},
{ack_timeout, AckTimeout},
{connection_type, supervisor}|SocketOpts],
ProtoSup, ProtoOpts),