commit 9f3dac2f77ec22f46b2a34fb68aea5da9f93eed5
parent dd9fe953560781117c10cbd316ed4337966718a0
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 15 Nov 2026 16:44:55 +0100
fix #12138
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/sync/sync-httpd2.c b/src/sync/sync-httpd2.c
@@ -32,6 +32,16 @@
#include "sync-httpd2_get-backups-KEY-blocks.h"
#include "sync-httpd2_get-backups-KEY-blocks-reconcile.h"
+/**
+ * Maximum number of concurrent connections per HTTP daemon.
+ * TALER_MHD_daemon_start() keeps our descriptors below FD_SETSIZE
+ * (1024). 300 connections is plenty, same as exchange. At the
+ * limit, MHD stops accepting, so that other sync-httpd
+ * processes sharing the listen socket (as high-performance setups do
+ * via systemd) take the connection.
+ */
+#define CONNECTION_LIMIT 300
+
/**
* @brief A handler for a backup sub-operation under /backups/$KEY/.
@@ -682,6 +692,7 @@ start_daemon (void *cls,
MHD_DAEMON_SET_OPTIONS (
mhd,
MHD_D_OPTION_DEFAULT_TIMEOUT_MILSEC (10000),
+ MHD_D_OPTION_GLOBAL_CONNECTION_LIMIT (CONNECTION_LIMIT),
MHD_D_OPTION_LARGE_POOL_SIZE (
(size_t) GNUNET_MIN (
((uint_fast64_t) SH_upload_limit_mb)