From 6abbf7db4a5f9473618709098d47408595580439 Mon Sep 17 00:00:00 2001 From: Wen Guan Date: Thu, 1 Feb 2024 12:09:08 +0100 Subject: [PATCH] update wsgi listen backlog limitation --- Dockerfile | 4 ++++ .../panda_server-httpd-FastCGI.conf.rpmnew.template | 4 +++- .../sysconfig/panda_server.sysconfig.rpmnew.template | 9 +++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index dcd46ddda..832b18307 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,10 @@ RUN yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x RUN yum install --nogpgcheck -y postgresql16 RUN yum clean all && rm -rf /var/cache/yum +# update network limitations +echo 4096 > /proc/sys/net/core/somaxconn +sysctl -w net.core.somaxconn=4096 + # setup venv with pythonX.Y RUN python$(echo ${PYTHON_VERSION} | sed -E 's/\.[0-9]+$//') -m venv /opt/panda RUN /opt/panda/bin/pip install --no-cache-dir -U pip diff --git a/templates/panda_server-httpd-FastCGI.conf.rpmnew.template b/templates/panda_server-httpd-FastCGI.conf.rpmnew.template index fecc55b7d..4d70f86d2 100644 --- a/templates/panda_server-httpd-FastCGI.conf.rpmnew.template +++ b/templates/panda_server-httpd-FastCGI.conf.rpmnew.template @@ -28,6 +28,8 @@ MaxRequestWorkers ${PANDA_SERVER_CONF_MAX_WORKERS} MaxConnectionsPerChild 2000 +ListenBackLog ${PANDA_SERVER_CONF_MAX_BACKLOG} + ServerName ${PANDA_SERVER_CONF_SERVERNAME} DocumentRoot "@@install_purelib@@/pandaserver" @@ -78,7 +80,7 @@ Alias /auth/ "/opt/panda/etc/panda/auth/" WSGIPythonHome /opt/panda - WSGIDaemonProcess pandasrv_daemon processes=${PANDA_SERVER_CONF_NUM_WSGI} threads=1 home=/home/atlpan + WSGIDaemonProcess pandasrv_daemon processes=${PANDA_SERVER_CONF_NUM_WSGI} threads=8 home=/home/atlpan WSGIProcessGroup pandasrv_daemon WSGIApplicationGroup %{GLOBAL} WSGIScriptAliasMatch ^/server/panda/(.+)$ @@install_purelib@@/pandaserver/server/panda.py diff --git a/templates/sysconfig/panda_server.sysconfig.rpmnew.template b/templates/sysconfig/panda_server.sysconfig.rpmnew.template index 111e1a553..a0aef19db 100644 --- a/templates/sysconfig/panda_server.sysconfig.rpmnew.template +++ b/templates/sysconfig/panda_server.sysconfig.rpmnew.template @@ -61,7 +61,7 @@ fi # min number of workers if [[ -z "${PANDA_SERVER_CONF_MIN_WORKERS}" ]]; then - export PANDA_SERVER_CONF_MIN_WORKERS=25 + export PANDA_SERVER_CONF_MIN_WORKERS=32 fi # max number of workers @@ -71,7 +71,12 @@ fi # max number of WSGI daemons if [[ -z "${PANDA_SERVER_CONF_NUM_WSGI}" ]]; then - export PANDA_SERVER_CONF_NUM_WSGI=12 + export PANDA_SERVER_CONF_NUM_WSGI=32 +fi + +# max number of WSGI daemons +if [[ -z "${PANDA_SERVER_CONF_MAX_BACKLOG}" ]]; then + export PANDA_SERVER_CONF_MAX_BACKLOG=2000 fi # port