uwsgi配置

[uwsgi]
http-socket = :80       ;指定项目执行的端口号--nginx用socket,直接运行用http
listen = 1024           ;设置socket监听队列大小
plugin = python3        ;使用插件-编程语言
chdir = /code/project   ;指定项目目录
process = 8             ;开启进程数量
enable-threads = 8      ;允许用内嵌的语言启动线程;这将允许你在app程序中产生一个子线程
max-requests = 8192     ;设置每个进程请求数上限
harakiri = 60           ;请求超时时长.请求超时,该工作进程就会被回收重启(重用)
master = true           ; 允许主线程存在
die-on-term = true      ;
log-x-forwarded-for = true
log-format-strftime = true
log-date = %%Y-%%m-%%d %%H:%%M:%%S  ;日志时间
log-format = UWSGI: %(ftime) %(addr) %(method) %(uri) %(status) %(size) %(msecs) %(uagent)  ;日志格式
daemonize = /code/app_web.log   ;进程后台运行,并将日志打印到指定的文件
nwsgi-file = project/wsgi.py    ;uwsgi日志文件
pidfile = /uwsgi.pid    ;指定pid文件


启动命令: uwsgi --ini uwsgin.ini
重启命令: uwsgi --reload uwsgi.pid
关闭命令: uwsgi --stop uwsgi.pid
实时状态: uwsgi --connect-and-read uwsgi/uwsgi.status

linux自动配置命令:

echo -e "[uwsgi]\nhttp-socket = :80\nlisten = 1024\nplugin = python3\nlisten = 1024\nchdir = ${WORK_DIR}\nprocesses = ${UWSGI_PROCESSES}\nenable-threads = true\nthreads = 8\nmax-request = 8192\nharakiri = 60\nmaster = true\ndie-on-term = true\nlog-x-forwarded-for = true\nlog-format-strftime = true\nlog-date = %%Y-%%m-%%d %%H:%%M:%%S\nlog-format = UWSGI: %(ftime) %(addr) %(method) %(uri) %(status) %(size) %(msecs) %(uagent)\ndaemonize = /code/app_web.log\nwsgi-file = ${WSGI_FILE}\npidfile = /uwsgi.pid"> /uwsgi.ini curl 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章