如何計算MySQL QPS和TPS的值
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)
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)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2132736/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL中TPS和QPS的計算方式MySql
- 【MySQL】計算 TPS,QPS 的python 指令碼MySqlPython指令碼
- MySQL實時計算QPS,TPS的SHELL指令碼兩例MySql指令碼
- 如何提高系統的吞吐量(QPS/TPS)
- 實用QPS和TPS高的高效分析方法
- 樹莓派 redis 壓力測試 QPS 和 TPS樹莓派Redis
- mysql狀態檢視 QPS/TPS/快取命中率檢視MySql快取
- 透過原始碼看看Redis中如何計算QPS原始碼Redis
- 已計算的關鍵值和限制的關鍵值
- 系統吞吐量、TPS(QPS)、使用者併發量、效能測試概念和公式公式
- MySQL中Innodb如何計算索引的統計資訊?MySql索引
- 簡述 QPS、TPS、併發使用者數、吞吐量關係
- MySQL如何計算統計redo log大小MySql
- MYSQL INNODB 如何計算B+樹表的最大容量和行數MySql
- MySQL Cluster:如何通過擴充套件為MySQL帶來2億QPSMySql套件
- 平行計算π值
- (高階)繼承的值與計算的值繼承
- 圖解計算機中的數值範圍和浮點運算圖解計算機
- 使用AWK計算某一列的所有數值和
- Octave 數值計算
- 峰值QPS/QPS/PV/UV/伺服器數量/併發數/吐吞量/響應時間計算公式伺服器公式
- 演算法題:如何判斷計算的 π 值是否精確?演算法
- 樹,計算父節點的值
- 36:計算多項式的值
- 如何快速的計算subnet和broadcastAST
- TPS和專案管理專案管理
- 遊戲設計:從《死亡迴歸》看TPS和Roguelike遊戲設計
- 數值計算 插值與擬合
- 數值計算基礎
- 使用 Python 計算 π 值Python
- python 計算 sin 值Python
- fd最大值和限制 linux 下 file-max 的最大值計算方法Linux
- 廣西快三和值計算公式10467567公式
- 【轉】QPS和併發數的關係
- 效能測試中如何確定TPS和併發數
- 數值計算的可靠性(一)
- 數值計算的可靠性(二)
- 數值計算的可靠性(三)