base: nginx tornado 
目标: tornado 实现多端口多进程运行

pip install supervisor
echo_supervisord_conf > /etc/supervisord.conf   # 默认echo_supervisord_conf 在python/bin 目录下 
配置/etc/supervisord.conf
command=python /data/www/app/app.py --port=600%(process_num)d
process_name=%(program_name)s%(process_num)d
numprocs=6         ; 开启6个子进程
numprocs_start=1   ; 上面的process_num从1开始  
directory=/data/www/app
autostart=true
autorestart=false
;startsecs=5                   ; number of secs prog must stay running (def. 1)
startretries=3                ; max # of serial start failures (default 3)
;stopsignal=QUIT               ; signal used to kill process (default TERM)
;stopwaitsecs=10               ; max num secs to wait b4 SIGKILL (default 10)
;stopasgroup=false             ; send stop signal to the UNIX process group (default false)
;killasgroup=false             ; SIGKILL the UNIX process group (def false)
user=root                   ; setuid to this UNIX account to run the program
redirect_stderr=true          ; redirect proc stderr to stdout (default false)
stdout_logfile=/data/logs/supervisor/order.log        ; stdout log path, NONE for none; default AUTO
stderr_logfile=/data/logs/supervisor/order_error.log        ; stderr log path, NONE for none; default AUTO
;serverurl=AUTO                ; override serverurl computation (childutils)</code>

相关文章:

  • 2021-05-31
  • 2021-10-13
  • 2021-04-23
  • 2021-07-12
  • 2021-11-28
  • 2021-06-17
  • 2021-04-24
猜你喜欢
  • 2021-11-07
  • 2022-12-23
  • 2022-01-12
  • 2022-03-05
  • 2022-12-23
相关资源
相似解决方案