uWSGI配置參數釋義

uWSGI配置參數釋義

 

socket : 地址和端口號,例如:socket = 127.0.0.1:50000服務器

processes : 開啓的進程數量app

workers : 開啓的進程數量,等同於processes(官網的說法是spawn the specified number of  workers / processes)socket

chdir : 指定運行目錄(chdir to specified directory before apps loading)post

wsgi-file : 載入wsgi-file(load .wsgi file)spa

stats : 在指定的地址上,開啓狀態服務(enable the stats server on the specified address)線程

threads : 運行線程。因爲GIL的存在,我以爲這個真心沒啥用。(run each worker in prethreaded mode with the specified number of threads)unix

master : 容許主進程存在(enable master process)日誌

daemonize : 使進程在後臺運行,並將日誌打到指定的日誌文件或者udp服務器(daemonize uWSGI)。實際上最經常使用的,仍是把運行記錄輸出到一個本地文件上。server

log-maxsize :以固定的文件大小(單位KB),切割日誌文件。 例如:log-maxsize = 50000000  就是50M一個日誌文件。 進程

pidfile : 指定pid文件的位置,記錄主進程的pid號。

vacuum : 當服務器退出的時候自動清理環境,刪除unix socket文件和pid文件(try to remove all of the generated file/sockets)

disable-logging : 不記錄請求信息的日誌。只記錄錯誤以及uWSGI內部消息到日誌中。若是不開啓這項,那麼你的日誌中會大量出現這種記錄:

[pid: 347|app: 0|req: 106/367] 117.116.122.172 () {52 vars in 961 bytes} [Thu Jul  7 19:20:56 2016] POST /post => generated 65 bytes in 6 msecs (HTTP/1.1 200) 2 headers in 88 bytes (1 switches on core 0)

log-maxsize: 日誌大小,當大於這個大小會進行切分 (Byte)

log-truncate: 當啓動時切分日誌

相關文章
相關標籤/搜索