Gunicorn worker creating zombie processes

余生长醉 提交于 2019-12-11 06:28:00

问题


Not really an issue, but I do want to understand what is going on. And also why do these zombie process get created. Also would like to see if there is a good practice for this kind of thing.

For now I do kill -HUP on the master gunicorn process, and it gets rid of the zombie processes. (I'm going to automatically kill -HUP every morning for log rotations) I'm wondering is there a way to figure out why these workers are spinning a zombie process?

Here is the ps auxef output.

    USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root      40436  0.0  0.0  107848  12920 ?      S    May02   0:12 /usr/local/bin/python2.7 /usr/local/bin/gunicorn -c /path/to/app/config.py my_app.wsgi:application -D HOSTNAME=DOCKER_ON_SERVER1
    root      40457  0.5  0.2 2368200 360080 ?      Sl   May02   8:53  \_ /usr/local/bin/python2.7 /usr/local/bin/gunicorn -c /path/to/app/config.py my_app.wsgi:application -D HOSTNAME=DOCKER_ON_SERVER1
    root      93779  0.0  0.0       0      0 ?      Z    01:10   0:33  |   \_ [gunicorn] <defunct>
    root      40468  0.7  0.3 2364540 476160 ?      Sl   May02  11:45  \_ /usr/local/bin/python2.7 /usr/local/bin/gunicorn -c /path/to/app/config.py my_app.wsgi:application -D HOSTNAME=DOCKER_ON_SERVER1
    root      97980  0.1  0.0       0      0 ?      Z    02:20   0:47  |   \_ [gunicorn] <defunct>
    root      40473  1.3  0.4 2395816 652012 ?      Sl   May02  20:13  \_ /usr/local/bin/python2.7 /usr/local/bin/gunicorn -c /path/to/app/config.py my_app.wsgi:application -D HOSTNAME=DOCKER_ON_SERVER1
    root     128111  8.0  0.0       0      0 ?      Z    10:39   3:27  |   \_ [gunicorn] <defunct>
    root      40474  0.4  0.2 2364272 325696 ?      Sl   May02   7:22  \_ /usr/local/bin/python2.7 /usr/local/bin/gunicorn -c /path/to/app/config.py my_app.wsgi:application -D HOSTNAME=DOCKER_ON_SERVER1
    root      40480  0.7  0.3 2388004 508060 ?      Sl   May02  11:18  \_ /usr/local/bin/python2.7 /usr/local/bin/gunicorn -c /path/to/app/config.py my_app.wsgi:application -D HOSTNAME=DOCKER_ON_SERVER1
    root      98738  0.1  0.0       0      0 ?      Z    02:32   0:40  |   \_ [gunicorn] <defunct>
    root      40483  1.0  0.5 2394524 662576 ?      Sl   May02  15:36  \_ /usr/local/bin/python2.7 /usr/local/bin/gunicorn -c /path/to/app/config.py my_app.wsgi:application -D HOSTNAME=DOCKER_ON_SERVER1
    root      92217  0.2  0.0       0      0 ?      Z    00:44   1:41  |   \_ [gunicorn] <defunct>
    root      40488  1.2  0.5 2400848 701204 ?      Sl   May02  18:05  \_ /usr/local/bin/python2.7 /usr/local/bin/gunicorn -c /path/to/app/config.py my_app.wsgi:application -D HOSTNAME=DOCKER_ON_SERVER1
    root      99735  0.4  0.0       0      0 ?      Z    02:48   2:06  |   \_ [gunicorn] <defunct>
    root      41895  1.3  0.4 2393788 647628 ?      Sl   May02  19:10  \_ /usr/local/bin/python2.7 /usr/local/bin/gunicorn -c /path/to/app/config.py my_app.wsgi:application -D HOSTNAME=DOCKER_ON_SERVER1
    root     119069  2.0  0.0       0      0 ?      Z    08:09   3:52      \_ [gunicorn] <defunct>

来源:https://stackoverflow.com/questions/43765371/gunicorn-worker-creating-zombie-processes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!