From 82ae162290d13d847b050e9c7ae27cf4984f05bc Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 10 Nov 2016 19:53:30 +0000 Subject: [PATCH] Bug 17610 - Allow the number of plack workers and max connections to be set in koha-conf.xml It would be nice if we could control the number of workers and max requests on a per instance basis, rather than the numbers being hardcoded in the plack startup script. Test Plan: 1) Build a new package of Koha with this patch applied ; ) 2) Verify koha-plack still works 3) Add the following to the config section of your koha-conf.xml: 75 4 4) Stop plack 5) Start plack 6) Verify the number of works and max requests worked! --- debian/scripts/koha-plack | 13 ++++++++++++- etc/koha-conf.xml | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/debian/scripts/koha-plack b/debian/scripts/koha-plack index ed0f421..5c3484e 100755 --- a/debian/scripts/koha-plack +++ b/debian/scripts/koha-plack @@ -74,7 +74,18 @@ start_plack() _check_and_fix_perms $instancename - STARMANOPTS="-M FindBin --max-requests 50 --workers 2 \ + PLACK_MAX_REQUESTS="50" + PLACK_WORKERS="2" + + if [[ $(xmlstarlet sel -t -m '//plack_max_requests' -v . < /etc/koha/sites/${instancename}/koha-conf.xml) ]]; then + PLACK_MAX_REQUESTS="$(xmlstarlet sel -t -m '//plack_max_requests' -v . < /etc/koha/sites/${instancename}/koha-conf.xml)" + fi + + if [[ $(xmlstarlet sel -t -m '//plack_workers' -v . < /etc/koha/sites/${instancename}/koha-conf.xml) ]]; then + PLACK_WORKERS="$(xmlstarlet sel -t -m '//plack_workers' -v . < /etc/koha/sites/${instancename}/koha-conf.xml)" + fi + + STARMANOPTS="-M FindBin --max-requests ${PLACK_MAX_REQUESTS} --workers ${PLACK_WORKERS} \ --user=${instancename}-koha --group ${instancename}-koha \ --pid ${PIDFILE} \ --daemonize \ diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml index 1ce3c90..38a8081 100644 --- a/etc/koha-conf.xml +++ b/etc/koha-conf.xml @@ -138,5 +138,8 @@ __PAZPAR2_TOGGLE_XML_POST__ __FONT_DIR__/DejaVuSans-BoldOblique.ttf + 50 + 2 + -- 2.1.4