From fbc1868597d7dc3ab854b75ddf8fe3f8969ae899 Mon Sep 17 00:00:00 2001 From: Elbakyan Shirak Date: Wed, 14 Aug 2024 12:18:03 +0400 Subject: [PATCH] fix Bug 66631 - Correct RabbitMQ connections limit (#759) --- run-document-server.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/run-document-server.sh b/run-document-server.sh index 7dca625..8fccfee 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -104,7 +104,9 @@ 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} # 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)} +LIMIT=$(ulimit -n); [ $LIMIT -gt 1048576 ] && LIMIT=1048576 +NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$LIMIT} +RABBIT_CONNECTIONS=${RABBIT_CONNECTIONS:-$LIMIT} JWT_ENABLED=${JWT_ENABLED:-true} @@ -699,6 +701,8 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then chmod 400 ${RABBITMQ_DATA}/.erlang.cookie fi + echo "ulimit -n $RABBIT_CONNECTIONS" >> /etc/default/rabbitmq-server + LOCAL_SERVICES+=("rabbitmq-server") # allow Rabbitmq startup after container kill rm -rf /var/run/rabbitmq