From 16abfb6e06873d90a6d55fd6755a40dd208a21df Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Fri, 8 Aug 2025 15:07:49 +0200 Subject: [PATCH] DOC: config: document "shm-stats-file" directive Add some documentation for "shm-stats-file" and "shm-stats-file-max-objects" experimental directives related to the use of shared memory for storing stats counters (see previous commits for implementation details) --- doc/configuration.txt | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index dff2b491e..b88de47e5 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -3100,6 +3100,34 @@ setenv the configuration file sees the new value. See also "presetenv", "resetenv", and "unsetenv". +shm-stats-file [ EXPERIMENTAL ] + When this directive is set, it enables the use of shared memory for storing + stats counters. is used as argument to shm_open() to open the shared + memory at a unique location. It also means that the directive is only + available on systems which support shm_open(). When SHM is used for stats, all + shareable counters for frontends, backends, listeners and servers will be + stored in the SHM, provided that they have a GUID set. When reloading haproxy, + new process will try to scan the SHM for objects that could be associated to + objects defined in the configuration based on GUID and type, the goal is to be + able to preserve some counters' values upon reload. On the other hand, when + haproxy is properly stopped, the SHM objects are released, which means counters + are effectively reset. It is also possible to manually remove the file before + starting a fresh process to force a reset. + + See also "guid", "guid-prefix" and "shm-stats-file-max-objects" + +shm-stats-file-max-objects [ EXPERIMENTAL ] + This setting defines the maximum number of objects the shared memory used + for shared counters will be able to store per thread group. It is directly + related to the maximum memory size of the shm and is used to "premap" the + shm to a given size in order to avoid runtime re-mapping. It defaults to 2k, + which should suit for most setups without risking unsuitable memory usage, + but can be easily changed if needed. haproxy will complain during startup if + this value is to low to register objects that are expected to be stored in + the shared memory. It is only relevant when "shm-stats-file" was defined. + + See also "thread-groups" + ssl-default-bind-ciphers This setting is only available when support for OpenSSL was built in. It sets the default string describing the list of cipher algorithms ("cipher suite") @@ -7323,7 +7351,7 @@ guid types. Format is left unspecified to allow the user to select its naming policy. The only restriction is its length which cannot be greater than 127 characters. All alphanumerical values and '.', ':', '-' and '_' - characters are valid. + characters are valid. See also "shm-stats-file". hash-balance-factor @@ -16733,6 +16761,7 @@ guid-prefix allocated on this bind line. Prefix will be concatenated to listeners position index on the current bind line, with character '-' as separator. See "guid" proxy keyword description for more information on its format. + See also "shm-stats-file". id Fixes the socket ID. By default, socket IDs are automatically assigned, but @@ -17782,7 +17811,8 @@ guid Specify a case-sensitive global unique ID for this server. This must be unique across all haproxy configuration on every object types. See "guid" - proxy keyword description for more information on its format. + proxy keyword description for more information on its format. See also + "shm-stats-file". hash-key May be used in the following contexts: tcp, http, log