当前位置:网站首页>Using subprocess residue in supervisor and python multiprocessing

Using subprocess residue in supervisor and python multiprocessing

2020-11-07 20:57:57 Coxhuang

List of articles

  • supervisor and Python Of multiprocessing Use of
    • #1 Environmental Science
    • #2 demand
    • #3 solve Python Multi process and supervisor problem

supervisor and Python Of multiprocessing Use of

#1 Environmental Science

Ubuntu 16.04
Python 3.8.1

#2 demand

  • Use supervisor management Python The program , When Python Used in program multiprocessing modular ,supervisor Of stop and restart Instructions only kill the main process , The child process will remain

#3 solve Python Multi process and supervisor problem

killasgroup It can be said that it is specially adapted Python Of multiprocessing modular , If the stopasgroup=true, that killasgroup It will also default to true, So we just need to configure stopasgroup=true that will do , Be careful stopasgroup and killasgroup The types of signals sent are different .

Configuration example :

[group:multiprocesstest]
programs=multiprocess

[program:multiprocess]
command=python3 /home/cox/work/test/multiprocess_suspend/multiprocess_suspend.py
directory=/home/cox
user=cox
autorestart=true
redirect_stderr=true
stopasgroup=true

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

版权声明
本文为[Coxhuang]所创,转载请带上原文链接,感谢