QPS:每秒的查詢數 TPS:每秒的事物量 QPS的計算方法 Questions = SHOW GLOBAL STATUS LIKE 'Questions'; Uptime = SHOW GLOBAL STATUS LIKE 'Uptime'; QPS=Questions/Uptime 例如: mysql> show global status like 'questions'; +---------------+-----------+ | Variable_name | Value | +---------------+-----------+ | Questions | 449106827 | +---------------+-----------+ 1 row in set (0.00 sec)
mysql> show global status like 'uptime'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | Uptime | 238722 | +---------------+--------+ 1 row in set (0.00 sec)
mysql> select 449106827/238722 as 'QPS VALUE' from dual; +-----------+ | QPS VALUE | +-----------+ | 1881.2963 | +-----------+ 1 row in set (0.00 sec)
___________________________________________________________
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 例如: mysql> SHOW GLOBAL STATUS LIKE 'Com_commit'; +---------------+----------+ | Variable_name | Value | +---------------+----------+ | Com_commit | 71050554 | +---------------+----------+ 1 row in set (0.00 sec)
mysql> SHOW GLOBAL STATUS LIKE 'Com_rollback'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | Com_rollback | 537161 | +---------------+--------+ 1 row in set (0.00 sec)
mysql> SHOW GLOBAL STATUS LIKE 'Uptime'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | Uptime | 238827 | +---------------+--------+ 1 row in set (0.00 sec)
mysql> select (71050554+537161)/238827 as 'TPS VALUE' from dual; +-----------+ | TPS VALUE | +-----------+ | 299.7472 | +-----------+ 1 row in set (0.00 sec) |
免責聲明:本站部分文章和圖片均來自用戶投稿和網絡收集,旨在傳播知識,文章和圖片版權歸原作者及原出處所有,僅供學習與參考,請勿用于商業用途,如果損害了您的權利,請聯系我們及時修正或刪除。謝謝!
始終以前瞻性的眼光聚焦站長、創業、互聯網等領域,為您提供最新最全的互聯網資訊,幫助站長轉型升級,為互聯網創業者提供更加優質的創業信息和品牌營銷服務,與站長一起進步!讓互聯網創業者不再孤獨!
掃一掃,關注站長網微信