mysql5.0.x statistics and additions per second to change the number of replacements and system per second disk IO

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.