From 47472d58b8d26946874131c76d00907ab9216d4a Mon Sep 17 00:00:00 2001 From: evgeniy-antonyuk Date: Fri, 28 Oct 2022 18:55:34 +0300 Subject: [PATCH] Limiting the maximum number of simultaneous connections due to possible memory shortage --- run-document-server.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run-document-server.sh b/run-document-server.sh index 427cdae..caa6ae1 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -73,7 +73,8 @@ NGINX_ONLYOFFICE_EXAMPLE_CONF="${NGINX_ONLYOFFICE_EXAMPLE_PATH}/includes/ds-exam NGINX_CONFIG_PATH="/etc/nginx/nginx.conf" NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} -NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-1024} +# Limiting the maximum number of simultaneous connections due to possible memory shortage +[ $(ulimit -n) -gt 1048576 ] && NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-1048576} || NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)} JWT_ENABLED=${JWT_ENABLED:-true}