uwsgi reload-mercy & worker-reload-mercy

本文详细介绍了uwsgi在平滑重启时所涉及的两个关键参数:reload-mercy和worker-reload-mercy的区别及正确用法,并通过实例展示了如何设置这两个参数来调整进程重启的超时时间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

uWSGI文档中(http://uwsgi-docs.readthedocs.org/en/latest/Options.html)只有reload-mercy选项(默认值:60)

以为这是针对在平滑重启uwsgi进程中的设置超时选项,在实际操作中设置reload-mercy=10之后,重新加载uwsgi进程好像该选项并没有起作用。

查看uwsgi日志,日志中输出是的信息依然是60s.

[2013-06-06 13:55:23] - your mercy for graceful operations on workers is 60 seconds

最后google上查到问题,问题的描述是在uwsgi的官方maillist中(原始的maillist没找到)

参考一下2个链接:

1.http://comments.gmane.org/gmane.comp.python.wsgi.uwsgi.general/5188

2.http://www.mail-archive.com/uwsgi@lists.unbit.it/msg05159.html

 

原来还有一个参数叫“worker-reload-mercy” 但是在官方在线文档中,没有这个选项说明。

Roberto给出的解释如下:

--worker-reload-mercy is what you need, reload-mercy is a global value used as a fallback

 

这2个选项区别是:

--reload-mercy - used when reloading/stopping whole uWSGI instance
--worker-reload-mercy - used when reloading/stopping single worker

了解上面的选择区别后,修改配置文件 添加

worker-reload-mercy = 10 

然后reload uwsgi进程,日志输出

[2013-06-06 15:01:15] - your mercy for graceful operations on workers is 10 seconds

OK.问题解决。

转载于:https://www.cnblogs.com/lazyboy/archive/2013/06/06/3121217.html

Traceback (most recent call last): Traceback (most recent call last): File "/home/MSB-Financlal/financial/main.py", line 12, in <module> File "/home/MSB-Financlal/financial/main.py", line 12, in <module> Traceback (most recent call last): Traceback (most recent call last): File "/home/MSB-Financlal/financial/main.py", line 12, in <module> File "/home/MSB-Financlal/financial/main.py", line 12, in <module> from financial import create_app from financial import create_app ModuleNotFoundError: No module named 'financial' ModuleNotFoundError: No module named 'financial' unable to load app 0 (mountpoint='') (callable not found or import error) unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** no app loaded. going in full dynamic mode *** from financial import create_app from financial import create_app ModuleNotFoundError: No module named 'financial' ModuleNotFoundError: No module named 'financial' unable to load app 0 (mountpoint='') (callable not found or import error) unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** no app loaded. going in full dynamic mode *** Wed May 28 19:52:40 2025 - uWSGI worker 3 error: the master disconnected from this worker. Shutting down the worker. Wed May 28 19:52:40 2025 - uWSGI worker 2 error: the master disconnected from this worker. Shutting down the worker. Wed May 28 19:52:40 2025 - uWSGI worker 1 error: the master disconnected from this worker. Shutting down the worker. Wed May 28 19:52:40 2025 - uWSGI worker 2 error: the master disconnected from this worker. Shutting down the worker. Wed May 28 19:52:40 2025 - uWSGI worker 1 error: the master disconnected from this worker. Shutting down the worker. Wed May 28 19:52:40 2025 - uWSGI worker 4 error: the master disconnected from this worker. Shutting down the worker. Wed May 28 19:52:40 2025 - uWSGI worker 4 error: the master disconnected from this worker. Shutting down the worker.
最新发布
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值