gunicorn README

The project's README from github.com/benoitc/gunicorn. As one markdown file: README.md.

Gunicorn

Gunicorn is maintained by volunteers. If it powers your production, please consider supporting us:
GitHub Sponsors Revolut

PyPI version Supported Python versions Build Status

Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resource usage, and fairly speedy.

New in v25: Per-app worker allocation for dirty arbiters, HTTP/2 support (beta)!

Quick Start

pip install gunicorn
gunicorn myapp:app --workers 4

For ASGI applications (FastAPI, Starlette):

gunicorn myapp:app --worker-class asgi

Features

Documentation

Full documentation at https://gunicorn.org

Community

Support

Powering Python apps since 2010. Support continued development.

Become a Sponsor

Sponsors

Enki Multimedia

License

Gunicorn is released under the MIT License. See the LICENSE file for details.

gunicorn (benoitc/gunicorn)

Searching Database…

10.7K ·GitHub
这是什么?Gunicorn——全称 'Green Unicorn'——是一个运行在 UNIX 上的 Python WSGI HTTP 服务器。它就是实际运行你的 Python Web 应用并把它提供给外界访问的那个进程。
Gunicorn 是我用来搭建应用的框架,还是部署时用的服务器?既不是框架也不是库——它是部署在你已完成应用前面的服务器。它几乎能配合任何 Python Web 框架:通过 WSGI 使用 Django、Flask 或 Pyramid,通过 ASGI 使用 FastAPI、Starlette 或 Quart。
我怎么让它运行我的应用?先用 pip 安装 gunicorn 包,然后让 gunicorn 命令指向你的应用;文档里有 Quickstart,还有一个专门针对 ASGI 应用的 Quick Start。
它需要哪个 Python 版本?Python 3.10 或更新版本。
是不是所有功能都能用于生产环境,还是有测试版的部分?核心服务器从 2010 年起就一直在支撑各种 Python 应用,但两个最新的功能还处于 beta 阶段:支持多路复用流的 HTTP/2 和 Dirty Arbiters,两者都是在 v25 中引入的。
它能运行在哪些系统上——Linux、macOS 还是 Windows?UNIX 系统:Linux、macOS 和 FreeBSD(仓库里甚至配置了 FreeBSD CI)。它不能在 Windows 上运行。
可以免费使用吗,包括商业用途?可以——它采用 MIT 许可证,完全免费,没有付费版本。
Dirty Arbiters 是什么?这是 Gunicorn 在 v25 中新增的一个 beta 功能,面向机器学习模型或长时间运行任务这类高负载场景,按应用来分配 worker。如果你的应用要运行慢、吃资源的任务,值得关注的就是这个功能。
大家会把它放在 nginx 后面吗?这是经典做法:Gunicorn 专门支持 uWSGI 二进制协议,就是为了让 nginx 能直接和它对接。
它对服务器资源的占用大吗?设计上很轻量——README 称它实现简单、服务器资源占用少,而且速度相当快。它的定位就是跑在你的应用前面,而不会占满整台机器。
Creator
benoitc
Size
10.4 MB
Stars
10.7K
Age
16y
Commits · 90 Days