From 04ecc3cef1822cfab63a83b624e3f5591f61e8b1 Mon Sep 17 00:00:00 2001 From: Andreas Jonsson Date: Wed, 4 Feb 2026 11:55:26 +0100 Subject: [PATCH] Bug 41767: Plack backlog parameter Set a low default --backlog parameter for starman to allow for faster recovery when system becomes overloaded. Also expose configuration parameter for tuning. Test plan: * At the command line verify that the parameter "--backlog 50" is present for starman processes, provided that --max-requests 50 --workers 2: > ps aux | grep starman * Edit /etc/koha/sites/kohadev/koha-conf.xml and add 157 (e.g., next to ). * Restart plack: > koha-plack --restart kohadev * Verify that the --backlog parameter has changed accordingly --- debian/scripts/koha-plack | 4 +++- debian/templates/koha-conf-site.xml.in | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/scripts/koha-plack b/debian/scripts/koha-plack index 9a31d419e42..cfbb7f771a2 100755 --- a/debian/scripts/koha-plack +++ b/debian/scripts/koha-plack @@ -89,6 +89,8 @@ start_plack() [ -z $PLACK_MAX_REQUESTS ] && PLACK_MAX_REQUESTS="50" PLACK_WORKERS=$(run_safe_xmlstarlet $instancename plack_workers) [ -z $PLACK_WORKERS ] && PLACK_WORKERS="2" + PLACK_BACKLOG=$(run_safe_xmlstarlet $instancename plack_backlog) + [ -z $PLACK_BACKLOG ] && PLACK_BACKLOG=$(( $PLACK_WORKERS * $PLACK_MAX_REQUESTS / 2 )) instance_user="${instancename}-koha" @@ -100,7 +102,7 @@ start_plack() daemonize="--daemonize" logging="--access-log /var/log/koha/${instancename}/plack.log \ --error-log /var/log/koha/${instancename}/plack-error.log" - max_requests_and_workers="--max-requests ${PLACK_MAX_REQUESTS} --workers ${PLACK_WORKERS}" + max_requests_and_workers="--max-requests ${PLACK_MAX_REQUESTS} --workers ${PLACK_WORKERS} --backlog ${PLACK_BACKLOG}" # Enable debugger? if [ "$debugger" = "yes" ] && [ "$environment" = "development" ]; then diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index 0e07af36d8f..143dc6efaab 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -339,6 +339,9 @@ __END_SRU_PUBLICSERVER__ 50 2 + + +