supervisor和gunicorn基础知识

pip install gunicore

gunicore启动web服务

gunicorn --worker=3 main:app -b 127.0.0.1:5000

gunicorn -w4 -b0.0.0.0:8000 myproject:app

进入项目启动配置文件,用supervisor启动,不用gunicore了

supervisorctl -c supervisor.conf

supervisor配置文件配置:

[program:lianxi]

command=/Users/cheng/workspace/lianxi/bin/gunicorn -w 4 -b 0.0.0.0:8000 myapp:app

directory=/Users/cheng/workspace/lianxi/lianxi/myproject

;startsecs=0

;stopwaitsecs=0

autostart=true

autorestart=true

;user=cheng

stdout_logfile=/Users/cheng/workspace/lianxi/log/gunicorn.log

stderr_logfile=/Users/cheng/workspace/lianxi/log/gunicorn.err

 

shift+g移动到下一行

用gunicorn执行web项目

/Users/cheng/workspace/lianxi/bin/gunicorn -w 4 -b 0.0.0.0:8000 myapp:app

日志文件在/tem/下的内容

netstat -na | grep 8000 查看端口占用情况

ps aux | grep supervisor

ps -ef | grep supervisor

转载于:https://my.oschina.net/u/3841099/blog/3026127

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值