Python--uWSGI(二)
来源:互联网 发布:js混淆加密压缩工具 编辑:程序博客网 时间:2024/06/02 03:36
uWSGI配置
配置uWSGI有很多种方式:
- ini(常用的,即创建一个文件为“xxx.ini”)
- xml(像写网页一样然后保存为”xxx.xml”)
- json(没用过)
- yaml(没用过)
ini的方式配置
1,ini配置为 key=value 形式
2,在ini配置文件里,#号为注释,
3,布尔值为 true 和 false
4,在命令行里,uwsgi myconf.ini 等价于 uwsgi –ini myconf.ini
配置选项
选项格式
1,命令行参数格式:--<option>
2,配置格式(以ini为例):option = xxxx
常用选项
socket : 地址和端口号,例如:socket = 127.0.0.1:50000
processes : 开启的进程数量
workers : 开启的进程数量,等同于processes(官网的说法是spawn the specified number of workers / processes)
chdir : 指定运行目录(chdir to specified directory before apps loading)
wsgi-file : 载入wsgi-file(load .wsgi file)
stats : 在指定的地址上,开启状态服务(enable the stats server on the specified address)
threads : 运行线程。由于GIL的存在,我觉得这个真心没啥用。(run each worker in prethreaded mode with the specified number of threads)
master : 允许主进程存在(enable master process)
daemonize : 使进程在后台运行,并将日志打到指定的日志文件或者udp服务器(daemonize uWSGI)。实际上最常用的,还是把运行记录输出到一个本地文件上。
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)
- Python--uWSGI(二)
- Python--Nginx+uWSGI+Flask(二)
- Python--uWSGI
- ubuntu nginx python uwsgi
- ngnix+uwsgi+django+python
- 安装python和uwsgi
- nginx+uwsgi+Python
- nginx+uwsgi python应用
- Python--Nginx+uWSGI+Flask
- Python--Nginx+uWSGI+Flask (三)日志找错误
- python uwsgi实现的简单web服务器(8代码)
- uwsgi+django+nginx+supervisor部署web应用(python)
- nginx+uwsgi+python捕获http消息并处理(一)
- 配置 python(django)+nginx+uwsgi
- nginx+uwsgi部署python应用
- [uWSGI] Python threading and locks
- centos + python + uwsgi 搭建网站
- python flask+uwsgi+tengine 容器
- POJ 1037 A decorative fence(美丽栅栏)__动态规划
- 加拿大签证材料(一家三口)
- Seafile开源私有云自定义首页Logo图片
- 确界原理
- JDK工具 javac命令详解
- Python--uWSGI(二)
- Android入门开发之基本控件TextView(十)
- 详解.NET IL代码
- Python学习总结笔记(9)-- MySQL数据库操作之mysql-connector
- 详解.NET IL代码(补充)
- 回溯法解决0-1背包问题
- Vmware上基于Ubuntu的kvm安装和Ubuntu的嵌套安装
- Python--Nginx+uWSGI+Flask
- Java泛型