Python Gunicorn 介绍

发布时间: 更新时间: 总字数:870 阅读时间:2m 作者:IP:上海 网址

Gunicorn(Green Unicorn) 是一个 UNIX 环境下的 Python WSGI HTTP Server。它是从 RubyUnicorn 项目移植的 pre-fork worker 模型。Gunicorn 服务器与众多 Web 框架广泛兼容,它具有实现简单、轻量级、响应速度快等特点。

安装

pip install gunicorn

help

gunicorn--help

使用

  • 一般和 supervisior 一起使用,前端通过 nginx 做前端。
  • gunicorn 多进程之间的 dict 不共享,可以使用 redis 或 memcache 实现共享
  • 优雅重启 kill -HUP <gunicorn-main-pid>
本文总阅读量 次 本站总访问量 次 本站总访客数