V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
dingyaguang117
V2EX  ›  问与答

uwsgi 如何安全停止?

  •  
  •   dingyaguang117 · Jul 8, 2014 · 5664 views
    This topic created in 4316 days ago, the information mentioned may be changed or developed.
    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在数据一致性,服务可靠性要求高的情况下,如何选择服务器?要求可以优雅停止、重启。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2431 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:16 · PVG 10:16 · LAX 19:16 · JFK 22:16
    ♥ Do have faith in what you're doing.