nginx + gunicorn + pypy + gevent 部署 web.py

nginx配置:

 

server {
    listen 9010;
    server_name xxx.xxx.net;

    location / {
        proxy_pass http://127.0.0.1:9011;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}


gunicorn配置:

 

 

#!/bin/bash
source /etc/profile
kill -9 $(ps -ef|grep gunicorn|gawk '$0 !~/grep/ {print $2}' |tr -s '\n' ' ')
rm -f ./*.pyc
#nohup pypy intf.py 9010 > /dev/null 2>&1 &
nohup gunicorn -w 8 -b 127.0.0.1:9011 intf:application > /dev/null 2>&1 &

 

pypy:见 http://blog.csdn.net/aspnet_lyc/article/details/78615136

 

gevent:

from gevent import monkey; monkey.patch_all()

 

web.py支持uwsgi:

app = web.application(urls, globals())
application = app.wsgifunc()

if __name__ == '__main__':
    app.run() 

 

 

 

 

 

 

 

发布了234 篇原创文章 · 获赞 55 · 访问量 89万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 深蓝海洋 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览