Waitress is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones which live in the Python standard library. It runs on CPython on Unix and Windows under Python 2.6+ and Python 3.2. It is also known to run on PyPy 1.6.0 on UNIX. It supports HTTP/1.0 and HTTP/1.1.
Here is a quote from their website on why they wrote it:
Why?
At the time of the release of Waitress, there are already many pure-Python WSGI servers. Why would we need another?
Waitress is meant to be useful to web framework authors who require broad platform support. It's neither the fastest nor the fanciest WSGI server available but using it helps eliminate the N-by-M documentation burden (e.g. production vs. deployment, Windows vs. Unix, Python 3 vs. Python 2, PyPy vs. CPython) and resulting user confusion imposed by spotty platform support of the current (2012-ish) crop of WSGI servers. For example, gunicorn is great, but doesn't run on Windows. paste.httpserver is perfectly serviceable, but doesn't run under Python 3 and has no dedicated tests suite that would allow someone who did a Python 3 port to know it worked after a port was completed. wsgiref works fine under most any Python, but it's a little slow and it's not recommended for production use as it's single-threaded and has not been audited for security issues.
At the time of this writing, some existing WSGI servers already claim wide platform support and have serviceable test suites. The CherryPy WSGI server, for example, targets Python 2 and Python 3 and it can run on UNIX or Windows. However, it is not distributed separately from its eponymous web framework, and requiring a non-CherryPy web framework to depend on the CherryPy web framework distribution simply for its server component is awkward. The test suite of the CherryPy server also depends on the CherryPy web framework, so even if we forked its server component into a separate distribution, we would have still needed to backfill for all of its tests. The CherryPy team has started work on Cheroot, which should solve this problem, however.
Waitress is a fork of the WSGI-related components which existed in zope.server. zope.server had passable framework-independent test coverage out of the box, and a good bit more coverage was added during the fork. zope.server has existed in one form or another since about 2001, and has seen production usage since then, so Waitress is not exactly "another" server, it's more a repackaging of an old one that was already known to work fairly well.
"The original WSGI specification (PEP 333) only supports Python 2.X. There is support in mod_wsgi for Python 3.X which is based on guesses as to what the WSGI specification would look like for Python 3.X. The new WSGI specification (PEP 3333) has finally now been accepted and although some tweaks need to be made to mod_wsgi to make it more strict, if you write your Python 3 WSGI application according to PEP 3333, it will work perfectly fine on mod_wsgi. If you wish to experiment with Python 3.X, you will need to use Python 3.1 or later."
我喜欢 Rocket Web 服务器,特别是因为它本身是用 python 编写的。它还具有用于创建其他类型服务器的 API。我能够以最少的努力将其调整为 XMLRPC 服务器。
I like the Rocket Web server, particular because it is itself written in python. It also has an API for creating other kinds of servers. I was able to adapt it into an XMLRPC server with a minimal amount of effort.
Meinheld is a high-performance WSGI-compliant web server that takes advantage of greenlet and picoev to enable asynchronous network I/O in a light-weight manner.
Similar to bjoern, meinheld is mostly written in C for speed and is built around a high-performance event library (picoev vs libev by bjoern). Because of that, you'll also need to have GCC installed in order to build meinheld's C extension. Installable on Linux, MacOS and FreeBSD.
发布评论
评论(7)
正如 Gabriel 所指出的,Apache/mod_wsgi 3.X 支持 Python 3。其他选项包括 CherryPy WSGI 服务器和 uWSGI。
As pointed out by Gabriel, Apache/mod_wsgi 3.X supports Python 3. Other options are CherryPy WSGI server and uWSGI.
Waitress
Waitress 旨在成为一个生产质量的纯 Python WSGI 服务器,具有非常可接受的性能。除了 Python 标准库中的依赖项之外,它没有任何依赖项。它在 Python 2.6+ 和 Python 3.2 下的 Unix 和 Windows 上的 CPython 上运行。众所周知,它可以在 UNIX 上的 PyPy 1.6.0 上运行。它支持 HTTP/1.0 和 HTTP/1.1。
以下是他们网站上的一段引用,说明了他们编写此文的原因:
Waitress
Waitress is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones which live in the Python standard library. It runs on CPython on Unix and Windows under Python 2.6+ and Python 3.2. It is also known to run on PyPy 1.6.0 on UNIX. It supports HTTP/1.0 and HTTP/1.1.
Here is a quote from their website on why they wrote it:
显然,根据 PEP 3333,最新版本的 mod_wsgi (3.3) 与 Python 3 兼容:
http:// code.google.com/p/modwsgi/
Apparently, the latest version of mod_wsgi (3.3) is compatible with Python 3 according to PEP 3333:
http://code.google.com/p/modwsgi/
我喜欢 Rocket Web 服务器,特别是因为它本身是用 python 编写的。它还具有用于创建其他类型服务器的 API。我能够以最少的努力将其调整为 XMLRPC 服务器。
I like the Rocket Web server, particular because it is itself written in python. It also has an API for creating other kinds of servers. I was able to adapt it into an XMLRPC server with a minimal amount of effort.
wsgiref,它是标准库的一部分。
wsgiref, which is a part of the standard library.
Phusion Passenger 从 3.0 版开始支持 PEP333。最初是 Ruby 应用服务器,现在正式支持 Python。其中功能包括:
Phusion Passenger 目前被纽约时报、AirBnB、皮克斯、赛门铁克等大型机构使用。
Phusion Passenger supports PEP333 since version 3.0. Originally a Ruby app server, it now officially supports Python. Amongst the features are:
Phusion Passenger is currently used by large parties like New York Times, AirBnB, Pixar, Symantec, etc.
bjoern
:快速且超轻量级的 HTTP/1.1 WSGI 服务器引用 自述文件:
如果您查看网络上的 WSGI 服务器基准(例如 Python WSGI 服务器性能分析),性能提升确实令人震惊:
如何安装
先决条件
在构建
bjoern
之前,您需要安装gcc
和libev
软件包:Debian/Ubuntu:
RHEL/CentOS:
Fedora:
MacOS:
从App Store安装XCode以获取
gcc
;对于libev
,从源代码构建或安装 vie Homebrew:Windows
不幸的是,Windows 不受支持,因为
libev
不可用。meinheld
:高性能异步WSGI Web服务器(基于picoev)引用官网 :
与
bjoern
类似,meinheld
主要用 C 语言编写以提高速度,并围绕高性能事件库构建 (picoev
与libev
bybjoern
)。因此,您还需要安装 GCC 才能构建meinheld
的 C 扩展。可安装在 Linux、MacOS 和 FreeBSD 上。安装
bjoern
: Fast And Ultra-Lightweight HTTP/1.1 WSGI ServerQuoting the README:
If you take a look at WSGI server benchmarks on the web (e.g. A Performance Analysis of Python WSGI Servers), the performance boost is indeed astounishing:
How to install
Prerequisites
You will need
gcc
andlibev
packages to be installed before buildingbjoern
:Debian/Ubuntu:
RHEL/CentOS:
Fedora:
MacOS:
Install XCode from App Store to get
gcc
; forlibev
, either build from source or install vie Homebrew:Windows
Unfortunately, Windows is not supported because
libev
is not available.meinheld
: a high performance asynchronous WSGI Web Server (based on picoev)Quoting the official site:
Similar to
bjoern
,meinheld
is mostly written in C for speed and is built around a high-performance event library (picoev
vslibev
bybjoern
). Because of that, you'll also need to have GCC installed in order to buildmeinheld
's C extension. Installable on Linux, MacOS and FreeBSD.Installation