Reprinted from: http://blog.chinaunix.net/uid-9370128-id-393082.html
1. mysql 5.0.x statistics per second increase, delete, change, check, replacement number
MySQL show global status can be traced from the previous start, the cumulative quantity, crawl once per second
#!/bin/bash
While True
Do
Echo-ne "' Date ' \ t"
Mysql-s/tmp/mysql.sock-e "show global status;" | Grep-e ' (queries|select|insert|delete|update|replace) | awk ' {if (length ($) <12) printf $ "" $ ""} ' |xargs
Sleep 1
Done
Output results
10:36:20 com_delete 1872 Com_insert 4011186 com_replace 8664696 com_select 1322812 com_update 3201479 Queries 35002301
10:36:21 com_delete 1872 Com_insert 4011197 com_replace 8664718 com_select 1322816 com_update 3201486 Queries 35002380
...
The results are calculated to increase, delete, change, check and replace quantity per second.
After testing, Queries records include SET, use, SHOW these instructions.
2. System disk I/O per second
Iostat-t-d-x-K 1 |grep-e ' (SDA2|SDB2) '
Output Result:
Time:06:05:19 PM
device:rrqm/s wrqm/s r/s w/s rkb/s wkb/s avgrq-sz avgqu-sz await SVCTM%util
SDA2 0.00 38.00 0.00 24.00 0.00 248.00 20.67 0.07 3.08 1.75 4.20
device:rrqm/s wrqm/s r/s w/s rkb/s wkb/s avgrq-sz avgqu-sz await SVCTM%util
SDB2 0.00 0.00 0.00 4.00 0.00 16.00 8.00 0.01 2.00 0.50 0.20
Time:06:05:20 PM
mysql5.0.x statistics and additions per second to change the number of replacements and system per second disk IO