From 6a4887d7fc31ff5699b29775a6b08b7ef0829613 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 8 Dec 2020 18:30:57 -0500 Subject: [PATCH] web: use env variables to set worker processes and connections Use 2 new environment variables to allow setting the number of nginx worker processes and connections. Add the variables to the docker-compose file and to the nginx-conf where default values are also set. --- docker-compose.yml | 2 ++ web/rootfs/defaults/nginx.conf | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f53bb7b..9145e99 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -71,6 +71,8 @@ services: - MATOMO_SITE_ID - MICROSOFT_API_APP_CLIENT_ID - NGINX_RESOLVER + - NGINX_WORKER_PROCESSES + - NGINX_WORKER_CONNECTIONS - PEOPLE_SEARCH_URL - RESOLUTION - RESOLUTION_MIN diff --git a/web/rootfs/defaults/nginx.conf b/web/rootfs/defaults/nginx.conf index 6f5ba4a..1accccf 100644 --- a/web/rootfs/defaults/nginx.conf +++ b/web/rootfs/defaults/nginx.conf @@ -1,10 +1,10 @@ user www-data; -worker_processes 4; +worker_processes {{ .Env.NGINX_WORKER_PROCESSES | default "4" }}; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { - worker_connections 768; + worker_connections {{ .Env.NGINX_WORKER_CONNECTIONS | default "768" }}; # multi_accept on; }