uWSGI: --master 和 --emperor 产生两个皇帝 [英] uWSGI: --master with --emperor spawns two emperors

查看:29
本文介绍了uWSGI: --master 和 --emperor 产生两个皇帝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我像这样启动 uwsgi,我可以看到:

I can see that if I start uwsgi like this:

sudo /usr/local/bin/uwsgi --emperor /etc/uwsgi/vassals --uid www --gid www

它创建了一个皇帝副本.但是,如果我另外以 --master 开头(如推荐的此处),它会创建两个皇帝副本.将 --master--emperor 一起使用是否有意义?我会说不,但如果我在没有该选项的情况下运行它,我会收到此警告:

it creates one emperor copy. But if I start it with --master additionally (as recommended here), it creates two emperor copies. Does it make sense to use --master with --emperor? I would say no, but if I run it without that option I get this warning:

*** 警告:您正在运行 uWSGI 没有其主进程管理器 ***

推荐答案

这里是 官方文档说:

皇帝一般不应该用--master运行,除非master特别需要高级日志记录等功能.

The emperor should generally not be run with --master, unless master features like advanced logging are specifically needed.

如果您想知道 master 选项的作用,这里是答案:

If you're wondering what master option does, here is the answer:

大师

uWSGI 内置的 prefork+threading 多线程管理模式,通过轻击主开关激活.对于所有实用服务部署 不使用 master 并不是一个好主意模式.

uWSGI’s built-in prefork+threading multi-worker management mode, activated by flicking the master switch on. For all practical serving deployments it’s not really a good idea not to use master mode.

总结一下:

  • 使用 --master 作为通常的 uWSGI 实例,
  • 不要将 --master 用于 uWSGI Emperor.
  • Use --master for usual uWSGI instance,
  • Do not use --master for uWSGI Emperor.

这篇关于uWSGI: --master 和 --emperor 产生两个皇帝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆