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