博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
uwsgi基础——服务状态
阅读量:5238 次
发布时间:2019-06-14

本文共 3163 字,大约阅读时间需要 10 分钟。

原文:

uWSGI 统计服务 (1.0-dev)

除了SNMP之外,uwsgi可以实时导出它的统计到一个socket上。

简单的使用--stats 加有效的socket:

--stats 127.0.0.1:1717--stats /tmp/statsock--stats :5050--stats @foobar

如果一个客户端连接上指定的socket,他会得到json数据包含内部统计信息。

uwsgi --socket :3031 --stats :1717 --module welcome --master --processes 8

then

nc 127.0.0.1 1717

会得到类似下面的:

{"workers": [        {
"id": 1, "pid": 31759, "requests": 0, "exceptions": 0, "status": "idle", "rss": 0, "vsz": 0, "running_time": 0, "last_spawn": 1317235041, "respawn_count": 1, "tx": 0, "avg_rt": 0, "apps": [ { "id": 0, "modifier1": 0, "mountpoint": "", "requests": 0, "exceptions": 0, "chdir": "" } ]}, {
"id": 2, "pid": 31760, "requests": 0, "exceptions": 0, "status": "idle", "rss": 0, "vsz": 0, "running_time": 0, "last_spawn": 1317235041, "respawn_count": 1, "tx": 0, "avg_rt": 0, "apps": [ { "id": 0, "modifier1": 0, "mountpoint": "", "requests": 0, "exceptions": 0, "chdir": "" } ]}, {
"id": 3, "pid": 31761, "requests": 0, "exceptions": 0, "status": "idle", "rss": 0, "vsz": 0, "running_time": 0, "last_spawn": 1317235041, "respawn_count": 1, "tx": 0, "avg_rt": 0, "apps": [ { "id": 0, "modifier1": 0, "mountpoint": "", "requests": 0, "exceptions": 0, "chdir": "" } ]}, {
"id": 4, "pid": 31762, "requests": 0, "exceptions": 0, "status": "idle", "rss": 0, "vsz": 0, "running_time": 0, "last_spawn": 1317235041, "respawn_count": 1, "tx": 0, "avg_rt": 0, "apps": [ { "id": 0, "modifier1": 0, "mountpoint": "", "requests": 0, "exceptions": 0, "chdir": "" } ]}, {
"id": 5, "pid": 31763, "requests": 0, "exceptions": 0, "status": "idle", "rss": 0, "vsz": 0, "running_time": 0, "last_spawn": 1317235041, "respawn_count": 1, "tx": 0, "avg_rt": 0, "apps": [ { "id": 0, "modifier1": 0, "mountpoint": "", "requests": 0, "exceptions": 0, "chdir": "" } ]}, {
"id": 6, "pid": 31764, "requests": 0, "exceptions": 0, "status": "idle", "rss": 0, "vsz": 0, "running_time": 0, "last_spawn": 1317235041, "respawn_count": 1, "tx": 0, "avg_rt": 0, "apps": [ { "id": 0, "modifier1": 0, "mountpoint": "", "requests": 0, "exceptions": 0, "chdir": "" } ]}, {
"id": 7, "pid": 31765, "requests": 0, "exceptions": 0, "status": "idle", "rss": 0, "vsz": 0, "running_time": 0, "last_spawn": 1317235041, "respawn_count": 1, "tx": 0, "avg_rt": 0, "apps": [ { "id": 0, "modifier1": 0, "mountpoint": "", "requests": 0, "exceptions": 0, "chdir": "" } ]}, {
"id": 8, "pid": 31766, "requests": 0, "exceptions": 0, "status": "idle", "rss": 0, "vsz": 0, "running_time": 0, "last_spawn": 1317235041, "respawn_count": 1, "tx": 0, "avg_rt": 0, "apps": [ { "id": 0, "modifier1": 0, "mountpoint": "", "requests": 0, "exceptions": 0, "chdir": "" } ]}]}

uwsgitop

uwsgitop 是一个类似top命令的状态服务。

You can get it from pypi with

easy_install uwsgitop

or

pip install uwsgitop

You can get the sources from github at:
 

转载于:https://www.cnblogs.com/wanself/archive/2012/11/27/2791310.html

你可能感兴趣的文章
P1373 小a和uim之大逃离 四维dp,维护差值
查看>>
NOIP2015 运输计划 树上差分+树剖
查看>>
P3950 部落冲突 树链剖分
查看>>
读书_2019年
查看>>
读书汇总贴
查看>>
微信小程序 movable-view组件应用:可拖动悬浮框_返回首页
查看>>
MPT树详解
查看>>
空间分析开源库GEOS
查看>>
RQNOJ八月赛
查看>>
前端各种mate积累
查看>>
jQuery 1.7 发布了
查看>>
Python(软件目录结构规范)
查看>>
Windows多线程入门のCreateThread与_beginthreadex本质区别(转)
查看>>
Nginx配置文件(nginx.conf)配置详解1
查看>>
linux php编译安装
查看>>
name phone email正则表达式
查看>>
721. Accounts Merge
查看>>
「Unity」委托 将方法作为参数传递
查看>>
重置GNOME-TERMINAL
查看>>
redis哨兵集群、docker入门
查看>>