flask项目uwsgi配置
[uwsgi]
http=0.0.0.0:port
http-socket=0.0.0.0:port
socket=0.0.0.0:port (三选一按自己需求选,a long story)
chdir=dir
wsgi-file=%(chdir)/xx.py
callable=app
processes=4
threads=1
pidfile=%(chdir)/uwsgi.pid
stats=%(chdir)/uwsgi.stats
master=true
add-header=Connection: Keep-Alive
http-keepalive = 1 (header里增加字段Connection, 用wrk压测时不会有大量readerror,)
chmod-socket=660
uid=root
gid=root
procname-prefix-spaced=xx
socket-timeout=6000
lazy-apps=true 先fork再加载 默认为false,先加载再fork
cpu-affinity=1
vacuum=true
reload-on-rss=2500 可以解决内存泄漏 unit:M