Skip to content

Commit

Permalink
update wsgi listen backlog limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
wguanicedew committed Feb 1, 2024
1 parent c219ce0 commit 6abbf7d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion templates/panda_server-httpd-FastCGI.conf.rpmnew.template
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ MaxRequestWorkers ${PANDA_SERVER_CONF_MAX_WORKERS}
MaxConnectionsPerChild 2000
</IfModule>

ListenBackLog ${PANDA_SERVER_CONF_MAX_BACKLOG}

ServerName ${PANDA_SERVER_CONF_SERVERNAME}

DocumentRoot "@@install_purelib@@/pandaserver"
Expand Down Expand Up @@ -78,7 +80,7 @@ Alias /auth/ "/opt/panda/etc/panda/auth/"

<IfModule mod_wsgi.c>
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
Expand Down
9 changes: 7 additions & 2 deletions templates/sysconfig/panda_server.sysconfig.rpmnew.template
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6abbf7d

Please sign in to comment.