Upstart 生成多个 uWSGI Emperor 进程

Upstart spawn multiple uWSGI Emperor processes

当 uWSGI 通过 Upstart 启动时,我有独立的 Emperor 实例,每个实例有两个进程(手动 运行,见下文)。

暴发户创建多个皇帝进程:

# ps ax | grep -i emper                                                                                                                       
  888 ?        S      0:53 uwsgi /etc/uwsgi/emperor.ini
  896 ?        S      0:33 uwsgi /etc/uwsgi/emperor.ini
  904 ?        S      0:52 uwsgi /etc/uwsgi/emperor.ini
  905 ?        S      0:34 uwsgi /etc/uwsgi/emperor.ini
  ...

当我杀死所有 Emperor 并 运行 它手动时,我有两个 Emperor 的进程和站点的工作人员:

# pstree -up | less
  ...
  -uwsgi(16347)---uwsgi(16348)-+-uwsgi(16349,web)-+-uwsgi(16358)
    |                             |                  |-uwsgi(16360)
    |                             |                  |-uwsgi(17058)
    |                             |                  |-uwsgi(17261)
    |                             |                  |-uwsgi(17410)
    |                             |                  |-uwsgi(17488)
    |                             |                  |-uwsgi(17750)
    |                             |                  `-uwsgi(17770)
    |                             `-uwsgi(16350,web)-+-uwsgi(16361)
    |                                                |-uwsgi(16362)
    |                                                |-uwsgi(16363)
    |                                                |-uwsgi(16364)
    |                                                |-uwsgi(16365)
    |                                                |-uwsgi(16366)
    |                                                |-uwsgi(16367)
    |                                                `-uwsgi(16368)

我的 Emperor Upstart 配置:

# Emperor uWSGI script

description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [06]

respawn

exec uwsgi /etc/uwsgi/emperor.ini

我的 uWSGI Emperor 配置:

[uwsgi]
  emperor-tyrant = true
  emperor = %dvassals
  emperor-pidfile = %demperor.pid
  emperor-stats = %demperor.stat.sock
  vassals-include = %dvassals-default.ini
  touch-logrotate = %p
  touch-reload = %p
  touch-reload = %dvassals-default.ini
  log-date = true
  log-truncate = true
  daemonize = /var/log/uwsgi/emperor.log

可能是我对 Upstart 配置有误? 日志对我没有帮助。

需要将 daemonize 更改为 logto

uWSGI 存储库中的更多信息:https://github.com/unbit/uwsgi/issues/1510