[uwsgi]

使用nginx连接时使用

socket=127.0.0.1:8000

直接做web服务器使用

http=127.0.0.1:8000

uwsgi 做web服务器使用配制静态文件

static-map=/static=/xxx/xx/static

项目目录

home=/python_env/petAppEnv
chdir=/users/.../.../你的项目根目录

项目中 wsgi.py文件的目录, 相对于chdir目录 启动的入口

wsgi-file=xxx/wsgi.py
如果有 no python application found, check your startup logs for errors
django中配制
module=xxx.wsgi:application

指定启动的工作进程数

processes=4
threads=2
master=true

保存启动成功之后一主进程的pid

pidfile=uwsgi.pid

保存的日志信息

daemonize=uwsgi.log

虚拟环境的目录路径

virtualenv=/xxx/xxx/xxx/

自动移除socket和pid 服务停止的时候

vacuum=true

设置缓冲

post-buffering=4096

设置中断时间

harakiri=30
callable=app # 调用的启动程序

uwsgi的启动和停止

启动 uwsgi --ini 配制文件的路径 example uwsgi --ini uwsgi.ini

停止 uwsgi --stop uwsgi.pid pid路径 example uwsgi --stop uwsgi.pid