From 4cbff2cad99b47c1c4765f5489c8b864900dcde0 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 20 Nov 2025 18:38:09 +0100 Subject: [PATCH] MINOR: limits: display the computed maxconn using ha_notice() The computed maxconn was only displayed in verbose or debug modes. This is too bad because lots of users just don't know what they're starting with and can be trapped when an environment changes. Let's use ha_notice() instead of a conditional fprintf() so that it gets displayed right after the other startup messages, hoping that users will get used to seeing it and more easily spot anomalies. See github issue #3191 for more context. --- src/limits.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/limits.c b/src/limits.c index b00cb8cc8..6587ee9b7 100644 --- a/src/limits.c +++ b/src/limits.c @@ -285,8 +285,7 @@ void set_global_maxconn(void) if (!global.rlimit_memmax) { if (global.maxconn == 0) { global.maxconn = ideal_maxconn; - if (global.mode & (MODE_VERBOSE|MODE_DEBUG)) - fprintf(stderr, "Note: setting global.maxconn to %d.\n", global.maxconn); + ha_notice("Automatically setting global.maxconn to %d.\n", global.maxconn); } } #ifdef USE_OPENSSL @@ -332,10 +331,8 @@ void set_global_maxconn(void) if (check_if_maxsock_permitted(compute_ideal_maxsock(global.maxconn))) break; } while (retried++ < 2); - - if (global.mode & (MODE_VERBOSE|MODE_DEBUG)) - fprintf(stderr, "Note: setting global.maxconn to %d and global.maxsslconn to %d.\n", - global.maxconn, global.maxsslconn); + ha_notice("Automatically setting global.maxconn to %d and global.maxsslconn to %d.\n", + global.maxconn, global.maxsslconn); } else if (!global.maxsslconn && (global.ssl_used_frontend || global.ssl_used_backend)) {