#先激活virtualenv
#啟動:uwsgi uwsgi.ini
#停止: uwsgi --stop uwsgi.pid
[uwsgi]
# 對外提供 http 服務的端口
http = :8000
#the local unix socket file than commnuincate to Nginx 用於和 nginx 進行數據交互的端口
socket = 127.0.0.1:8001
# the base directory (full path) django 程序的主目錄
chdir =/home/opadm/mms_webserver/src
# Django's wsgi file
wsgi-file =src/wsgi.py
# maximum number of worker processes
processes = 100
#thread numbers startched in each worker process
threads = 10
#一個高階的cheap模式,在啟動的時候只會分配n個工作進程,並使用自適應算法啟動新的進程
cheaper = 10
#在經過sec秒的不活躍狀態的進程會被銷毀(進入了cheap模式),並最少保留cheaper指定的進程數
idle = 3600
#monitor uwsgi status 通過該端口可以監控 uwsgi 的負載情況
stats = 127.0.0.1:9000
#設置一個請求的超時時間(秒),如果一個請求超過了這個時間,則請求被丟棄
harakiri = 60
#當一個請求被harakiri殺掉會,會輸出一條日志
harakiri-verbose = true
#開啟內存使用情況報告
memory-report = true
#設置平滑的重啟(直到處理完接收到的請求)的長等待時間(秒)
reload-mercy = 10
#設置工作進程使用虛擬內存超過N MB就回收重啟
reload-on-as= 1024
#自動給進程命名
auto-procname = true
#為進程指定前綴
procname-prefix-spaced = xc-mms
#設置工作進程每處理N個進程就會被回收重啟
max-requests=500000
#設置工作進程使用物理內存超過N MB就回收重啟
reload-on-rss=100
#設置socket超時時間,默認4秒
socket-timeout=10
#限制http請求體的大小(Bytes)
limit-post=4096
# clear environment on exit
vacuum = true
#不記錄request日志,只記錄錯誤日志
disable-logging = true
#將日志打印到syslog上
#log-syslog = true
# 后台運行,並輸出日志
daemonize = /home/opadm/log/uwsgi.log
stats=./uwsgi.status