高性能python wsgi web服务器

minefield的Python项目详细描述


这是什么

https://travis-ci.org/methane/minefield.svg

这是meinheld的叉子, 高性能python wsgi web服务器。

雷场删除了Meinheld和 做些实验性的调整。

minefield是一个符合wsgi的web服务器。(支持pep333和pep3333)

要求

雷区需要python 2.x>;=2.7python 3.x>;=3.3

Minefield支持Linux、FreeBSD、Mac OS X。

安装

从pypi安装:

$ pip install -U minefield

从源安装:

$ python setup.py install

雷场支持古尼孔。

要安装Gunicorn:

$ pip install -U gunicorn

基本用法

简单的wsgi应用程序:

from minefield import server

def hello_world(environ, start_response):
    status = '200 OK'
    res = b"Hello world!"
    response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(res)))]
    start_response(status, response_headers)
    return [res]

server.listen(("0.0.0.0", 8000))
server.run(hello_world)

和古尼康在一起。用户工作类“egg:minefield gunicorn_worker”或“minefield.gminefield.minefield worker”:

$ gunicorn --workers=2 --worker-class="egg:minefield#gunicorn_worker" gunicorn_test:app

性能

对于解析http请求,meinheld使用ryan dahl的http解析器库。

(见https://github.com/joyent/http-parser

它是围绕高性能事件库picoev构建的。

(见http://developer.cybozu.co.jp/kazuho/2009/08/picoev-a-tiny-e.html

发送文件

Meinheld在wgsi.file_包装器上使用sendfile(2)。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何通过jamod读取控制器的输入状态?   java Back bean方法在使用两个h的单一表单时未调用:selectonemenus和command button   mockitojava中的单元测试Mock继承方法   java在不传递到构造函数的情况下,将一个类的实例使用到另一个类中的最佳方法是什么   java Spring MVC:如何通过API在Dozer的toplevel字段中允许空值?   java hibernate到MSSQL服务器的连接被拒绝:连接   java动态调用现有变量   在java中扩展多个类的泛型   java使用JNA Ptrace获取linux中外部进程的信息?   eclipse获取Java项目中所有构建错误的最快方法是什么?   java将动态数组拆分为多个数组   java安卓:将json保存到sqlite   java获取最近时间Android   java如何为多对多关联编写HQL查询?   java Docker compose for mysql和spring应用程序拒绝访问   java查找数组(如果它是另一个数组的子集)   java如何在另一个具有相同数据类型参数的泛型类(或接口)中使用泛型类(或接口),而无需强制转换   Apache POI java。lang.NoClassDefFoundError:org/apache/commons/compress/utils/InputStreamStatistics   java使用Jackson将JSON反序列化为异构元素列表   使用MapReduce实现java规范化