gunicorn 简介
def app(environ, start_response):
data = b"Hello, World!\n"
start_response("200 OK", [
("Content-Type", "text/plain"),
("Content-Length", str(len(data)))
]) return iter([data])
可以看到app是非常标准的wsgi应用,然后我们启动gunicorn:gunicorn -w 2 gunicorn_app:app。 输出如下:




def run(self):
try:
Arbiter(self).run()
except RuntimeError as e:
print("\nError: %s\n" % e, file=sys.stderr)
sys.stderr.flush()
sys.exit(1)
- 0: FUNC:app(...) /home/xxx/gunicorn_app.py::16
- 1: FUNC:handle_request(...) /usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py::176
- 2: FUNC:handle(...) /usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py::135
- 3: FUNC:accept(...) /usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py::30
- 4: FUNC:run_for_one(...) /usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py::68
- 5: FUNC:run(...) /usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py::124
- 6: FUNC:init_process(...) /usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py::132
- 7: FUNC:spawn_worker(...) /usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py::557
- 8: FUNC:spawn_workers(...) /usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py::590
- 9: FUNC:manage_workers(...) /usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py::524
- 10: FUNC:run(...) /usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py::189
- 11: FUNC:run(...) /usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py::72
- 12: FUNC:run(...) /usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py::192
- 13: FUNC:run(...) /usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py::74
- 14: FUNC:<module>(...) /usr/local/bin/gunicorn::11
gunicorn 简介的更多相关文章
- Python3 Flask+nginx+Gunicorn部署(上)
前言:一般在本地运行flask项目通常是直接python3 文件名.py,然后打开:http://127.0.0.1:5000 查看代码结果 这次主要是记录flask在python3 环境结合ngin ...
- gunicorn 介绍与性能分析
阅读此文前建议先阅读 我的博客 gunicorn 是一个 python wsgi http server,只支持在 unix 系统上运行 安装 gunicorn 其实是 python 的一个包,安装方 ...
- Python之路【第一篇】:Python简介和入门
python简介: 一.什么是python Python(英国发音:/ pa θ n/ 美国发音:/ pa θɑ n/),是一种面向对象.直译式的计算机程序语言. 每一门语言都有自己的哲学: pyth ...
- python Gunicorn
1. 简介 Gunicorn(Green Unicorn)是给Unix用的WSGI HTTP 服务器,它与不同的web框架是非常兼容的.易安装.轻.速度快. 2. 示例代码1 def app(envi ...
- Python之路【第一篇】:Python简介和入门
python简介: 一.什么是python Python(英国发音:/ pa θ n/ 美国发音:/ pa θɑ n/),是一种面向对象.直译式的计算机程序语言. 每一门语言都有自己的哲学: pyth ...
- 【原创】大数据基础之Airflow(1)简介、安装、使用
airflow 1.10.0 官方:http://airflow.apache.org/ 一 简介 Airflow is a platform to programmatically author, ...
- Python3.x:第三方库简介
Python3.x:第三方库简介 环境管理 管理 Python 版本和环境的工具 p – 非常简单的交互式 python 版本管理工具. pyenv – 简单的 Python 版本管理工具. Vex ...
- Python Web开发中的WSGI协议简介
在Python Web开发中,我们一般使用Flask.Django等web框架来开发应用程序,生产环境中将应用部署到Apache.Nginx等web服务器时,还需要uWSGI或者Gunicorn.一个 ...
- Gunicorn、Supervisor
简介 Gunicorn来源于Ruby的unicorn项目,是一个Python WSGI HTTP Server,通过pre-fork worker模型来管理和维护worker. 简而言之就是通过多进程 ...
随机推荐
- 想要学习Linux技术,先好好的读一本Linux书籍吧
忘记你在使用windows时的使用习惯和使用思维.学习Linux,一定要适应Linux的命令行界面,因为命令行才是Linux的真正魅力所在,而X-window或着说桌面环境也只是运行在命令行模式下的一 ...
- 省市二级联动--使用app-jquery-cityselect.js插件
只有省市二级联动,三级联动还没处理好,会尽快完善. 嵌入id: <div class="form-group"> <label>地址</label&g ...
- webservice中采用协议Http,它是指什么意思
webservice 协议 Web Service使用的是 SOAP (Simple Object Access Protocol)协议soap协议只是用来封装消息用的.封装后的消息你可以通过各种已有 ...
- CodeForces 621B Wet Shark and Bishops
记录一下每个对角线上有几个,然后就可以算了 #include<cstdio> #include<cstring> #include<cmath> #include& ...
- Jboss 集群配置
环境配置:CentOS 7 x64 * 3 IP: 172.24.0.100 172.24.0.101 172.24.0.102 服务器配置: 172.24.0.100 ...
- STM32的NVIC_PriorityGroupConfig使用及优先级分组方式理解
STM32的NVIC_PriorityGroupConfig使用及优先级分组方式理解 STM32的优先级NVIC_PriorityGroupConfig的理解及其使用 STM32中断优先级彻底讲解 S ...
- Maven deploy时报Fatal error compiling: tools.jar not found错误的问题处理
摘自:http://blog.csdn.net/achilles12345/article/details/19046061 在Eclipse环境下,使用Maven进行deploy时发现报了该错误:F ...
- IOS 创建和设置pch
1.添加pch文件 2.修改工程配置文件 Building Settings->All->Apple LLVM 6.0 -Language -> Prefix Header
- iOS 之 UIStackView
UIStackView是iOS9新推出的布局控件,它的出现,可以说颠覆了以往的布局方式. 问题时,如果我使用UIStackView,它能用在iOS7.8系统中吗? 我要测试一下.测试程序我放到gith ...
- iOS 之 设置控件在视图中心位置
_qrImgView.bounds = CGRectMake(0, 0, sizeImg, sizeImg); _qrImgView.center = CGPointMake(CGRectGetWid ...