• mysql qps tps计算


    Information from web

    QPS (Query per second) (每秒查询量)
    TPS(Transaction per second) (每秒事务量,如果是InnoDB会显示,没有InnoDB就不会显示)

    1 计算方法
    ___________________________________________________________
    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';
    Uptime = SHOW GLOBAL STATUS LIKE 'Uptime';
    TPS=(Com_commit + Com_rollback)/Uptime

    2 第二种计算方法

    QPS

    use information_schema;
    select VARIABLE_VALUE into @num_queries from GLOBAL_STATUS where VARIABLE_NAME ='QUESTIONS';
    select VARIABLE_VALUE into @uptime from GLOBAL_STATUS where VARIABLE_NAME ='UPTIME';
    select @num_queries/@uptime;

    TPS

    use information_schema;
    select VARIABLE_VALUE into @num_com from GLOBAL_STATUS where VARIABLE_NAME ='COM_COMMIT';
    select VARIABLE_VALUE into @num_roll from GLOBAL_STATUS where VARIABLE_NAME ='COM_ROLLBACK';
    select VARIABLE_VALUE into @uptime from GLOBAL_STATUS where VARIABLE_NAME ='UPTIME';
    select (@num_com+@num_roll)/@uptime;

  • 相关阅读:
    Git 创建仓库并拉取代码
    Linux export 命令
    Linux ps 命令
    Linux sed 命令
    Linux find 命令
    Linux chmod 命令
    Linux chgrp 命令
    解除/配置 linux/nginx 的 tcp 连接(nginx配置文件日常配置推荐)
    更改Ubuntu的apt源
    anaconda 各版本的下载地址
  • 原文地址:https://www.cnblogs.com/liujianzuo888/p/5122137.html
Copyright © 2020-2023  润新知