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. 简而言之就是通过多进程 ...
随机推荐
- ural1650 Billionaires
Billionaires Time limit: 3.0 secondMemory limit: 64 MB You probably are aware that Moscow holds the ...
- 写插件时遇到的一个小问题,关于animate和css3的问题
昨天写代码时,偶然想到了如果我们把css3属性放在animate中,指定时间.能否实现动画呢.举个例子吧: <script> $(".box").animate({ & ...
- The 2014 ACMICPC Asia Regional Shanghai Online
XorZip小队第一次合作,虽然结果还是有些可惜,但是状态和感觉都还不错. [A]数论+二分(-_-///) [B]Lucas定理+数位DP(-_-///) [C]LCA.LCT+树链剖分 [D]题目 ...
- SDOI2016 R1 解题报告 bzoj4513~bzoj4518
储能表 将n, m分解为二进制,考虑一个log(n)层的trie树,n会在这颗trie树上走出了一个路径,因为 行数 $ \le n$,所以在n的二进制路径上,每次往1走的时候,与m计算贡献,m同样处 ...
- 模块之dir函数
dir()函数你可以使用内建的dir函数来列出模块定义的标识符.标识符有函数.类和变量.当你为dir()提供一个模块名的时候,它返回模块定义的名称列表.如果不提供参数,它返回当前模块中定义的名称列表. ...
- FFT初解(转)
源:FFT初解 一.前言 首先申明俺不是一个算法工程师,俺是一个底层驱动工程师,有人会发问一个底层驱动工程师需要这个吗?但是我不幸的告诉你,确实是需要的,不过我们不要像算法工程师那样搞得很精通,但是还 ...
- iOS开发之监听键盘高度的变化 分类: ios技术 2015-04-21 12:04 233人阅读 评论(0) 收藏
最近做的项目中,有一个类似微博中的评论转发功能,屏幕底端有一个输入框用textView来做,当textView成为第一响应者的时候它的Y值随着键盘高度的改变而改变,保证textView紧贴着键盘,但又 ...
- C++中string类的使用方法
如果所比较的两个string 相等,则返回0: 操作string 大于参数string,返回 正数:操作string 小于参数string,返回负数. (1) 比较操作string 与 _Str 或C ...
- JQueryUI确认框 confirm
$(function(){ $('#AlertMsg').dialog({ autoOpen: false, width: 300, modal: true, position: 'center', ...
- 安装arm-linux-gcc交叉编译器
1.开发平台 虚拟机:VMware 12 操作系统:Ubuntu 14.04 2.准备交叉编译工具包(arm-linux-gcc-4.5.1) 编译uboot和linux kernel都需要gnu交叉 ...