zoukankan      html  css  js  c++  java
  • uwsgi基础——服务状态

    原文: http://projects.unbit.it/uwsgi/wiki/StatsServer

    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://github.com/unbit/uwsgitop

  • 相关阅读:
    linux文件上传
    ios base64图片上传失败问题
    ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='
    配置SQL Server 2012 AlwaysOn ——step3 配置数据库
    配置SQL Server 2012 AlwaysOn ——step2 建立群集
    配置SQL Server 2012 AlwaysOn ——step1 建立AD域及DNS配置
    适应多场景应用的web系统架构探讨
    住院病案首页数据填写质量规范
    病案首页规范
    vs2015离线使用nuget
  • 原文地址:https://www.cnblogs.com/wanself/p/2791310.html
Copyright © 2011-2022 走看看