Skip to content

Commit 0870028

Browse files
Merge branch 'stable'
2 parents 18cb88e + 88485d9 commit 0870028

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ define PROJECT_ENV
2525
%% breaks the QPid Java client
2626
{frame_max, 131072},
2727
{channel_max, 0},
28+
{connection_max, infinity},
2829
{heartbeat, 60},
2930
{msg_store_file_size_limit, 16777216},
3031
{fhc_write_buffering, true},

docs/rabbitmq.config.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,25 @@
214214
%%
215215
%% {channel_max, 0},
216216

217+
%% Set the max permissible number of client connections to the node.
218+
%% `infinity` means "no limit".
219+
%%
220+
%% This limit applies to client connections to all listeners (regardless of
221+
%% the protocol, whether TLS is used and so on). CLI tools and inter-node
222+
%% connections are exempt.
223+
%%
224+
%% When client connections are rapidly opened in succession, it is possible
225+
%% for the total connection count to go slightly higher than the configured limit.
226+
%% The limit works well as a general safety measure.
227+
%%
228+
%% Clients that are hitting the limit will see their TCP connections fail or time out.
229+
%%
230+
%% Introduced in 3.6.13.
231+
%%
232+
%% Related doc guide: http://www.rabbitmq.com/networking.html.
233+
%%
234+
%% {connection_max, infinity},
235+
217236
%% TCP socket options.
218237
%%
219238
%% Related doc guide: http://www.rabbitmq.com/networking.html.

src/tcp_listener_sup.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ start_link(IPAddress, Port, Transport, SocketOpts, ProtoSup, ProtoOpts, OnStartu
4949
init({IPAddress, Port, Transport, SocketOpts, ProtoSup, ProtoOpts, OnStartup, OnShutdown,
5050
ConcurrentAcceptorCount, Label}) ->
5151
{ok, AckTimeout} = application:get_env(rabbit, ssl_handshake_timeout),
52+
MaxConnections = rabbit_misc:get_env(rabbit, connection_max, infinity),
5253
{ok, {{one_for_all, 10, 10}, [
5354
ranch:child_spec({acceptor, IPAddress, Port}, ConcurrentAcceptorCount,
5455
Transport, [{port, Port}, {ip, IPAddress},
55-
{max_connections, infinity},
56+
{max_connections, MaxConnections},
5657
{ack_timeout, AckTimeout},
5758
{connection_type, supervisor}|SocketOpts],
5859
ProtoSup, ProtoOpts),

0 commit comments

Comments
 (0)