V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
dingyaguang117
V2EX  ›  问与答

uwsgi 如何安全停止?

  •  
  •   dingyaguang117 · 2014 年 7 月 8 日 · 5570 次点击
    这是一个创建于 4222 天前的主题,其中的信息可能已经有所发展或是发生改变。
    1.看官网文档 http://uwsgi-docs.readthedocs.org/en/latest/Management.html#reloading-the-server ,使用-HUP可以优雅重启,不过我在测试的时候,却是直接杀死了,并没有等待请求处理结束(难道是因为我使用time.sleep(5)来模拟长作业的缘故?),日志如下,虽然显示200,不过浏览器那边却“连接已中断”

    ...gracefully killing workers...
    Gracefully killing worker 2 (pid: 9610)...
    Gracefully killing worker 1 (pid: 9609)...
    Gracefully killing worker 3 (pid: 9611)...
    Gracefully killing worker 4 (pid: 9639)...
    worker 1 buried after 1 seconds
    worker 2 buried after 1 seconds
    worker 3 buried after 1 seconds
    [pid: 9639|app: 0|req: 11/14] 111.206.83.99 () {42 vars in 1782 bytes} [Tue Jul 8 17:59:16 2014] GET /config/long => generated 2 bytes in 5005 msecs (HTTP/1.1 200) 1 headers in 51 bytes (1 switches on core 14)
    worker 4 buried after 4 seconds
    2.如何安全停止服务器?文档中似乎只有-INT是停止,不过似乎是直接干掉了uwsgi,并不等所有请求处理完成

    3.Python Webservice在数据一致性,服务可靠性要求高的情况下,如何选择服务器?要求可以优雅停止、重启。
    目前尚无回复
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3010 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:48 · PVG 21:48 · LAX 05:48 · JFK 08:48
    ♥ Do have faith in what you're doing.