python - pstree 显示了一些 Gunicorn 工人产生了 25 个其他子 gunicorn 进程
问题描述
我们的应用程序正在使用 supervisord 来运行 gunicorn 工作者。我们不在线程模式下运行 gunicorn,而是运行 8 个工作人员。下面是主管和 gunicorn conf 文件。独角兽:
#!/bin/bash
NAME="xyz"
DIR=/app/deploy/current/xyz
USER=xyz
GROUP=users
WORKERS=8
BIND=unix:/app/run/gunicorn.sock
DJANGO_SETTINGS_MODULE=xyz.settings
DJANGO_WSGI_MODULE=xyz.wsgi
LOG_LEVEL=error
cd $DIR
source /app/deploy/current/venv/bin/activate
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DIR:$PYTHONPATH
exec /app/deploy/current/venv/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \
--workers $WORKERS \
--user=$USER \
--timeout 100 \
--group=$GROUP \
--bind=$BIND \
--log-level=$LOG_LEVEL \
--log-file=- \
--max-requests=1000 \
--max-requests-jitter=200
导师
[xyz]
command=/usr/local/bin/be-gunicorn
user=xyz
autostart=true
autorestart=true
redirect_stderr=true
priority=998
stdout_logfile=/app/logs/gunicorn/gunicornstdout.log
stderr_logfile=/app/logs/gunicorn/gunicornstdout.log
问题是当我运行 pstree 时,它显示一些工人产生了 25 个其他我无法理解的 gunicorns 进程。这是因为孤儿工吗?有人可以帮助我了解这里发生了什么。在下面粘贴pstree -a
输出
├─supervisord /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
│ └─gunicorn /app/deploy/current/venv/bin/gunicorn xyz.wsgi:application --name xyz --workers 8 --user=xyz --timeout 100--group=
│ ├─gunicorn /app/deploy/current/venv/bin/gunicorn xyz.wsgi:application --name xyz --workers 8 --user=xyz --timeout 100--group=
│ │ ├─python -c from multiprocessing.semaphore_tracker import main;main(14)
│ │ └─25*[{gunicorn}]
│ ├─gunicorn /app/deploy/current/venv/bin/gunicorn xyz.wsgi:application --name xyz --workers 8 --user=xyz --timeout 100--group=
│ │ ├─python -c from multiprocessing.semaphore_tracker import main;main(14)
│ │ └─25*[{gunicorn}]
│ ├─gunicorn /app/deploy/current/venv/bin/gunicorn xyz.wsgi:application --name xyz --workers 8 --user=xyz --timeout 100--group=
│ │ ├─python -c from multiprocessing.semaphore_tracker import main;main(14)
│ │ └─25*[{gunicorn}]
│ ├─gunicorn /app/deploy/current/venv/bin/gunicorn xyz.wsgi:application --name xyz --workers 8 --user=xyz --timeout 100--group=
│ │ ├─python -c from multiprocessing.semaphore_tracker import main;main(14)
│ │ └─25*[{gunicorn}]
│ ├─gunicorn /app/deploy/current/venv/bin/gunicorn xyz.wsgi:application --name xyz --workers 8 --user=xyz --timeout 100--group=
│ │ ├─python -c from multiprocessing.semaphore_tracker import main;main(14)
│ │ └─25*[{gunicorn}]
│ ├─gunicorn /app/deploy/current/venv/bin/gunicorn xyz.wsgi:application --name xyz --workers 8 --user=xyz --timeout 100--group=
│ │ ├─python -c from multiprocessing.semaphore_tracker import main;main(14)
│ │ └─25*[{gunicorn}]
│ ├─gunicorn /app/deploy/current/venv/bin/gunicorn xyz.wsgi:application --name xyz --workers 8 --user=xyz --timeout 100--group=
│ │ ├─python -c from multiprocessing.semaphore_tracker import main;main(14)
│ │ └─25*[{gunicorn}]
│ └─gunicorn /app/deploy/current/venv/bin/gunicorn xyz.wsgi:application --name xyz --workers 8 --user=xyz --timeout 100--group=
│ ├─python -c from multiprocessing.semaphore_tracker import main;main(14)
│ └─25*[{gunicorn}]
这里的25*[{gunicorn}]
暗示是什么?是由于每个孩子的最大请求数还是这些是孤儿工人?
解决方案
推荐阅读
- android - 如何在 android studio 上的 firesbase 存储文件中显示所有图像
- go - 如何实现管道到 goroutines?
- python - 将两个系列合并/压缩到 ndarray 的 ndarray
- mysql - MySQL:通过关联选择
- matlab - 当 MATLAB 无法找到显式解决方案时,任何可能的步骤?
- hadoop - 安装 HBase 后,HMaster 进程不在 hadoop 多节点集群上运行
- angular - 如果在查看另一个组件时数据发生更改,则组件 DOM 不会更新
- swift - 在自己的类中显示 UIActivityViewController
- php - 如何在用户发送值时创建 PHP 配置文件?
- swift - 使用 GMSAutocomplete 显示城市和州 - Swift