I have a gunicorn web server on my django app in my docker container and my gunicorn config is:
bind = '0.0.0.0:8001'
loglevel = 'debug'
errorlog = '-'
accesslog = '-'
preload = True
reload = True
workers = 2
My gunicorn command is:
gunicorn -c gunicorn_conf.py project.wsgi:application
I am expecting it to only show 2 processes when I hit ps aux
in the container or docker top
but it turns out that it has three like the one below
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 21756 2600 ? Ss 21:48 0:00 /bin/bash /usr/src/app/entrypoint.sh
root 6 0.0 1.0 97424 21860 ? S 21:48 0:01 /usr/local/bin/python /usr/local/bin/gunicorn -c gunicorn_conf.py project.wsgi:application
root 11 2.7 3.2 310404 65560 ? Sl 21:48 1:20 /usr/local/bin/python /usr/local/bin/gunicorn -c gunicorn_conf.py project.wsgi:application
root 12 2.7 3.2 310408 65572 ? Sl 21:48 1:20 /usr/local/bin/python /usr/local/bin/gunicorn -c gunicorn_conf.py project.wsgi:application
Gunicorn拥有处理/生成工人的主流程,这就是为什么你看到3个流程(主人和2个工人)的原因
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.