summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/rabbitmq.conf.example7
-rw-r--r--priv/schema/rabbit.schema25
-rw-r--r--test/config_schema_SUITE_data/rabbit.snippets7
3 files changed, 36 insertions, 3 deletions
diff --git a/docs/rabbitmq.conf.example b/docs/rabbitmq.conf.example
index 9e04edb629..cfb67a2c88 100644
--- a/docs/rabbitmq.conf.example
+++ b/docs/rabbitmq.conf.example
@@ -40,6 +40,13 @@
# num_acceptors.tcp = 10
# num_acceptors.ssl = 10
+## Socket writer will force GC every so many bytes transferred.
+## Default is 1 GiB (`1000000000`). Set to 'off' to disable.
+##
+# socket_writer.gc_threshold = 1000000000
+#
+## To disable:
+# socket_writer.gc_threshold = off
## Maximum amount of time allowed for the AMQP 0-9-1 and AMQP 1.0 handshake
## (performed after socket connection and TLS handshake) to complete, in milliseconds.
diff --git a/priv/schema/rabbit.schema b/priv/schema/rabbit.schema
index 2054a48ccf..a8d720a4a9 100644
--- a/priv/schema/rabbit.schema
+++ b/priv/schema/rabbit.schema
@@ -59,7 +59,7 @@ fun(Conf) ->
end}.
%% Number of Erlang processes that will accept connections for the TCP
-%% and SSL listeners.
+%% and TLS listeners.
%%
%% {num_tcp_acceptors, 10},
%% {num_ssl_acceptors, 1},
@@ -73,13 +73,32 @@ end}.
]}.
+{mapping, "socket_writer.gc_threshold", "rabbit.writer_gc_threshold", [
+ {datatype, [{atom, off}, integer]}
+]}.
+
+{translation, "rabbit.writer_gc_threshold",
+ fun(Conf) ->
+ case cuttlefish:conf_get("socket_writer.gc_threshold", Conf, undefined) of
+ %% missing from the config
+ undefined -> cuttlefish:unset();
+ %% explicitly disabled
+ off -> undefined;
+ Int when is_integer(Int) andalso Int > 0 ->
+ Int;
+ _ ->
+ cuttlefish:invalid("should be a non-negative integer")
+ end
+ end
+}.
+
%% Maximum time for 0-9-1 handshake (after socket connection
-%% and SSL handshake), in milliseconds.
+%% and TLS handshake), in milliseconds.
%%
%% {handshake_timeout, 10000},
{mapping, "handshake_timeout", "rabbit.handshake_timeout", [
- {datatype, integer}
+ {datatype, [{atom, infinity}, integer]}
]}.
%% Set to 'true' to perform reverse DNS lookups when accepting a
diff --git a/test/config_schema_SUITE_data/rabbit.snippets b/test/config_schema_SUITE_data/rabbit.snippets
index 0137ad7bc1..82864f8eda 100644
--- a/test/config_schema_SUITE_data/rabbit.snippets
+++ b/test/config_schema_SUITE_data/rabbit.snippets
@@ -71,6 +71,13 @@ ssl_options.fail_if_no_peer_cert = true",
"listeners.ssl = none",[{rabbit,[{ssl_listeners,[]}]}],[]},
{num_acceptors,
"num_acceptors.ssl = 1",[{rabbit,[{num_ssl_acceptors,1}]}],[]},
+
+ {socket_writer_gc_threshold,
+ "socket_writer.gc_threshold = 999666111", [{rabbit, [{writer_gc_threshold, 999666111}]}],[]},
+
+ {socket_writer_gc_threshold_off,
+ "socket_writer.gc_threshold = off", [{rabbit, [{writer_gc_threshold, undefined}]}],[]},
+
{default_user_settings,
"default_user = guest
default_pass = guest