From 7ba8ef8e3a1dcefb7969056698d1dce2237dddfc Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi Date: Wed, 10 Apr 2019 12:53:46 +0200 Subject: [PATCH] Make the number fgci processes configurable --- README.md | 2 ++ server/Dockerfile | 4 +++- server/runtime/etc/apache2/conf-enabled/mapserver.conf | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 73bd8fa1..a048d589 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ to tune it: * MS_DEBUGLEVEL: The debug level 0=off 5=verbose * MS_ERRORFILE: If you want the debug to something other than STDOUT * MAX_REQUESTS_PER_PROCESS: To work around memory leaks (defaults to 1000) +* MIN_PROCESSES: The minimum number of fcgi processes to keep (defaults to 1) +* MAX_PROCESSES: The maximum number of fcgi processes to keep (defaults to 5) * MAPSERVER_CATCH_SEGV: Set to 1 to have the stacktraces in case of crash * LISTEN_PORT_80: When running the container as an unprivileged user, apache will listen to port 8080 instead of 80. Set to 1 force listening to port 80 diff --git a/server/Dockerfile b/server/Dockerfile index 4b925da4..f3ecd727 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -44,7 +44,9 @@ COPY target /usr/local/ ENV MS_DEBUGLEVEL=0 \ MS_ERRORFILE=/var/log/mapserver.log \ - MAX_REQUESTS_PER_PROCESS=1000 + MAX_REQUESTS_PER_PROCESS=1000 \ + MIN_PROCESSES=1 \ + MAX_PROCESSES=5 RUN adduser www-data root && \ chmod -R g+w ${APACHE_CONFDIR} ${APACHE_RUN_DIR} ${APACHE_LOCK_DIR} ${APACHE_LOG_DIR} /etc/confd /etc/mapserver /var/lib/apache2/fcgid /var/log && \ diff --git a/server/runtime/etc/apache2/conf-enabled/mapserver.conf b/server/runtime/etc/apache2/conf-enabled/mapserver.conf index 8c602f08..835c0358 100644 --- a/server/runtime/etc/apache2/conf-enabled/mapserver.conf +++ b/server/runtime/etc/apache2/conf-enabled/mapserver.conf @@ -1,5 +1,7 @@ # mapserver has memory leaks, this limit should improve long term memory usage FcgidMaxRequestsPerProcess ${MAX_REQUESTS_PER_PROCESS} +FcgidMinProcessesPerClass ${MIN_PROCESSES} +FcgidMaxProcessesPerClass ${MAX_PROCESSES} ScriptAliasMatch "^/.*" /usr/local/bin/mapserv_wrapper