美文网首页数据库专家
MySQL的QPS、TPS的获取

MySQL的QPS、TPS的获取

作者: 好小葱1 | 来源:发表于2018-08-02 16:20 被阅读2次

    QPS计算方法

    questions = show global status like 'questions';
    uptime = show global status like 'uptime';
    qps=questions/uptime
    

    TPS计算方法

    com_commit = show global status like 'com_commit';
    com_rollback = show global status like 'com_rollback';
    com_select = show global status like 'com_select';
    com_insert = show global status like 'com_insert';
    com_delete = show global status like 'com_delete';
    com_update = show global status like 'com_update';
    uptime = show global status like 'uptime';
    tps=(com_commit + com_rollback + com_select + com_insert + com_delete + com_update)/uptime
    

    or 运行命令

    root@ubuntu:~# mysqladmin status
    Uptime: 7708415  Threads: 281  Questions: 1530623457  Slow queries: 1616334  Opens: 749480  Flush tables: 1  Open tables: 800  Queries per second avg: 198.565
    

    相关文章

      网友评论

        本文标题:MySQL的QPS、TPS的获取

        本文链接:https://www.haomeiwen.com/subject/qbksvftx.html