下载uwsgitop 可以看每个processes的使用情况
pip install uwsgitop
uwsgi.ini里加上
# uwsgi 状态可视化
stats = /tmp/uwsgi-stats.sock
memory-report = true
要cd进入下载的虚拟环境
uwsgitop /tmp/uwsgi-stats.sock
可以看到processes用了多少秒
WID | % | PID | REQ | RPS | EXC | SIG | STATUS | AVG | RSS | VSZ | TX | ReSpwn | HC | RunT | LastSpwn |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
uwsgi 编号 | 子进程占 整个进程比 | 这个不是linux 的进程id | Worker从 最近一次启动算起 执行的请求次数 | 每秒 请求 次数 | 异常 次数 | 被管理 的uWSGI 信号 | 状态 idle空闲 cheap静置 busy运行 | 平均 请求 时间 | Resident Set Size | Virtual Memory Size | worker 传输 数据量 | 重启 次数 | 可以设置一个 请求超过多少 秒后会被中断 | 运行时间 | 最后运行 时间 |
1 | 52.3 | 32194 | 2368 | 0 | 1 | 0 | idle | 4ms | 0 | 0 | 16.2M | 252 | 0 | 23921.872 | 10:27:00 |
2 | 47.7 | 32189 | 2163 | 0 | 3 | 0 | idle | 6ms | 0 | 0 | 15.6M | 251 | 0 | 25376.805 | 10:26:22 |
0 | 0.0 | 0 | 0 | 0 | 0 | 0 | cheap | 0ms | 0 | 0 | 0 | 0 | 0 | 0.0 | —:—:— |