diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2017-10-20 21:26:30 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2017-10-20 21:26:30 +0300 |
| commit | 08700282b7176d62cb262a66eceb576610d66c4d (patch) | |
| tree | da13a90ecd96b18c32144ab26f0df160dcae5337 | |
| parent | 18cb88ee282b359987b42a36db2670ad76787464 (diff) | |
| parent | 88485d9d9e5586394fe3bb162181c0e723152a53 (diff) | |
| download | rabbitmq-server-git-08700282b7176d62cb262a66eceb576610d66c4d.tar.gz | |
Merge branch 'stable'
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | docs/rabbitmq.config.example | 19 | ||||
| -rw-r--r-- | src/tcp_listener_sup.erl | 3 |
3 files changed, 22 insertions, 1 deletions
@@ -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 9b30f89d4c..3d41ae138c 100644 --- a/docs/rabbitmq.config.example +++ b/docs/rabbitmq.config.example @@ -214,6 +214,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), |
