From 9912aa45cd2e24dc084791305fe0397885684086 Mon Sep 17 00:00:00 2001 From: Ralf Schmid Date: Wed, 17 Sep 2025 09:34:40 +0200 Subject: [PATCH 1/2] Added 'max_connections' function --- appendix/configure-database-server.rst | 35 ++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/appendix/configure-database-server.rst b/appendix/configure-database-server.rst index f3680cb8..c60cf8fe 100644 --- a/appendix/configure-database-server.rst +++ b/appendix/configure-database-server.rst @@ -39,19 +39,40 @@ Keep in mind that versions may differ from your setup - adapt where needed. $ sudo -u postgres psql -c 'SHOW config_file' Adjust ``max_connections`` (mandatory) - Zammad will take up to 200 connections by default, with below command you can raise this limit fairly high. + Zammad uses up to 200 connections by default. Depending on your setup + and load, you may want to change this value. - Raise maximum allowed number of connections: + Determine Value + To help you determine a number, Zammad ships a function to calculate a + suggestion. If executed, it asks you to input some integer values which + are the base for the calculation. - .. code-block:: console + Run it by using the command: - $ sed -i "/max_connections/c\max_connections = 2000" + .. code-block:: console - Apply changes by restarting postgresql and Zammad (in this order): + $ rake zammad:db:max_connections - .. code-block:: console + As an alternative, these values can be provided as environment variables. + In case they are set, the function bypasses the interactive input and just + calculates the suggestion. The environment variables are: - $ sudo systemctl restart postgresql zammad + - ``ZAMMAD_MAX_CONNECTIONS_WEB_SERVERS`` + - ``ZAMMAD_MAX_CONNECTIONS_CONCURRENT_CRONJOBS`` + - ``ZAMMAD_MAX_CONNECTIONS_CONCURRENT_MANUAL`` + + Adjust Value + Raise the maximum allowed number of connections: + + .. code-block:: console + + $ sed -i "/max_connections/c\max_connections = 2000" + + Apply changes by restarting postgresql and Zammad (in this order): + + .. code-block:: console + + $ sudo systemctl restart postgresql zammad Adjust PostgreSQL for bigger instances (optional) .. warning:: From 3329f40336ee965ecf349534c756aa6bdab2b4a4 Mon Sep 17 00:00:00 2001 From: Ralf Schmid Date: Wed, 17 Sep 2025 13:36:44 +0200 Subject: [PATCH 2/2] Removed environment variables; adjusted text --- appendix/configure-database-server.rst | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/appendix/configure-database-server.rst b/appendix/configure-database-server.rst index c60cf8fe..ab60c27e 100644 --- a/appendix/configure-database-server.rst +++ b/appendix/configure-database-server.rst @@ -44,8 +44,10 @@ Adjust ``max_connections`` (mandatory) Determine Value To help you determine a number, Zammad ships a function to calculate a - suggestion. If executed, it asks you to input some integer values which - are the base for the calculation. + suggestion. If executed, it asks you to input some integer values and + additionally uses internally known values for the calculation. Be aware + that the suggestion is instance specific. That means you must run the + calculation on the system you want to adjust the ``max_connection`` value. Run it by using the command: @@ -53,14 +55,6 @@ Adjust ``max_connections`` (mandatory) $ rake zammad:db:max_connections - As an alternative, these values can be provided as environment variables. - In case they are set, the function bypasses the interactive input and just - calculates the suggestion. The environment variables are: - - - ``ZAMMAD_MAX_CONNECTIONS_WEB_SERVERS`` - - ``ZAMMAD_MAX_CONNECTIONS_CONCURRENT_CRONJOBS`` - - ``ZAMMAD_MAX_CONNECTIONS_CONCURRENT_MANUAL`` - Adjust Value Raise the maximum allowed number of connections: