1、-p
启动16个进程,注意这里不是16核就启动16个进程,要根据代码实际运行情况来定夺 (There is no magic rule for setting the number of processes or threads to use. It is very much application and system dependent. Simple math like processes = 2 * cpucores will not be enough. You need to experiment with various setups and be prepared constantly monitor your apps. uwsgitop could be a great tool to find the best values.)
这里已经告诉你了,通过uwsgitop来判断,至于如何用uwsgitop,下面我会讲到
2、-l
linux内核监听网络队列长度,这个稍微大一点
3、-M
master模式,启动主进程
4、-R
--max-requests的简写, reload workers after the specified amount of managed requests。一个worker完成多少个请求以后就重启
5、-z
--socket-timeout的缩写 set internal sockets timeout
6、-L
--disable-logging的缩写 disable request logging,禁掉请求的系统日志,调试模式下要打开,生产环境注意关闭,这个东西很影响效率
7、--wsgi-file
程序入口
8、--max-apps
set the maximum number of per-worker applications,这个没啥特别大的意义,可不要
9、--stats 127.0.0.1:1717
监控程序的url,只有设置了这个参数以后才能用 uwsgitop 1717来观看监控,类似于linux的top命令,后面会专门提到
10 --post-buffering
enable post buffering,if an HTTP request has a body (like a POST request generated by a form), you have to read (consume) it in your application. If you do not do this, the communication socket with your webserver may be clobbered. If you are lazy you can use the post-buffering option that will automatically read data for you. For Rack applications this is automatically enabled.