当uWSGI通过Upstart启动时,我有独立的Emperor实例,每个实例有两个进程(手动运行,见下文)。
Upstart创建多个皇帝进程:
# 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's进程,其中有工作人员用于网站:
# 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)
我对皇帝的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配置上出错了吗? 日志对我没有帮助。
答案 0 :(得分:1)
需要将daemonize
更改为logto
。
uWSGI repo中的更多信息:https://github.com/unbit/uwsgi/issues/1510