diff --git a/man/flashmq.conf.5 b/man/flashmq.conf.5 index bc9c125f..a66e879d 100644 --- a/man/flashmq.conf.5 +++ b/man/flashmq.conf.5 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH flashmq.conf 5 "21 April 2024" "" "" +.TH flashmq.conf 5 "3 May 2024" "" "" .SH NAME flashmq.conf \- FlashMQ configuration file format .SH SYNOPSIS @@ -255,6 +255,24 @@ For \*(T<\fBminimum_wildcard_subscription_depth\fR\*(T>, specify what you want t Default: \*(T .TP +\*(T<\fBoverload_mode\fR\*(T> \fIlog/close_new_clients\fR +Define the action to perform when the value defined with \*(T<\fBmax_event_loop_drift\fR\*(T> is exceeded. + +When a server is (re)started, and hundreds of thousands of clients connect, the SSL handshaking and authenticating can be so heavy that it doesn't get to clients in time. They will then reconnect and try again, and get stuck in a loop. This option is to mitigate that. With \*(T, new clients will be closed immediately after connecting while the server is overloaded. This will allow the worker threads to process the new clients in a controlled manner. + +For really large deployments, this can be augmented with extra rate limiting in iptables, or other firewalls. A stateless method is preferred, like: \*(T + +The current default is \*(T, but that will likely change in the future. + +Default: \*(T +.TP +\*(T<\fBmax_event_loop_drift\fR\*(T> \fImilliseconds\fR +For \*(T<\fBoverload_mode\fR\*(T>, the maximum permissible thread drift before the overload action is taken. + +The drift values considered are those of the main loop, in which clients are accepted, and the median of all worker threads. + +Default: \*(T<2000\*(T> +.TP \*(T<\fBinclude_dir\fR\*(T> \fI/path/to/dir\fR Load *.conf files from the specified directory, to merge with the main configuration file. diff --git a/man/flashmq.conf.5.dbk5 b/man/flashmq.conf.5.dbk5 index 5e6b3443..b1249f7d 100644 --- a/man/flashmq.conf.5.dbk5 +++ b/man/flashmq.conf.5.dbk5 @@ -518,6 +518,42 @@ + + log/close_new_clients + + + Define the action to perform when the value defined with is exceeded. + + + When a server is (re)started, and hundreds of thousands of clients connect, the SSL handshaking and authenticating can be so heavy that it doesn't get to clients in time. They will then reconnect and try again, and get stuck in a loop. This option is to mitigate that. With close_new_clients, new clients will be closed immediately after connecting while the server is overloaded. This will allow the worker threads to process the new clients in a controlled manner. + + + For really large deployments, this can be augmented with extra rate limiting in iptables, or other firewalls. A stateless method is preferred, like: iptables -I INPUT -p tcp -m multiport --dports 8883,1883 --syn -m hashlimit --hashlimit-name newmqttconns --hashlimit-above 10000/second --hashlimit-burst 15000 -j DROP + + + The current default is log, but that will likely change in the future. + + + Default: log + + + + + + milliseconds + + + For , the maximum permissible thread drift before the overload action is taken. + + + The drift values considered are those of the main loop, in which clients are accepted, and the median of all worker threads. + + + Default: 2000 + + + + /path/to/dir diff --git a/man/flashmq.conf.5.html b/man/flashmq.conf.5.html index 44ded62a..2e5b92eb 100644 --- a/man/flashmq.conf.5.html +++ b/man/flashmq.conf.5.html @@ -574,6 +574,42 @@ +
overload_mode log/close_new_clients#
+
+

+ Define the action to perform when the value defined with max_event_loop_drift is exceeded. +

+

+ When a server is (re)started, and hundreds of thousands of clients connect, the SSL handshaking and authenticating can be so heavy that it doesn't get to clients in time. They will then reconnect and try again, and get stuck in a loop. This option is to mitigate that. With close_new_clients, new clients will be closed immediately after connecting while the server is overloaded. This will allow the worker threads to process the new clients in a controlled manner. +

+

+ For really large deployments, this can be augmented with extra rate limiting in iptables, or other firewalls. A stateless method is preferred, like: iptables -I INPUT -p tcp -m multiport --dports 8883,1883 --syn -m hashlimit --hashlimit-name newmqttconns --hashlimit-above 10000/second --hashlimit-burst 15000 -j DROP +

+

+ The current default is log, but that will likely change in the future. +

+

+ Default: log +

+
+ + + +
max_event_loop_drift milliseconds#
+
+

+ For overload_mode, the maximum permissible thread drift before the overload action is taken. +

+

+ The drift values considered are those of the main loop, in which clients are accepted, and the median of all worker threads. +

+

+ Default: 2000 +

+
+ + +
include_dir /path/to/dir#