pt-mysql-summary:本地安装、然后远程收集MySQL Server的基本信息
在安装percona-toolkit的时候,这个组件也一起安装完成了:安装参考:http://blog.csdn.net/mchdba/article/details/14209765
要先在数据库里面建立监控帐号:
grant all on *.* to pt@''%" identified by 'pt';
执行命令,察看结果
[root@472322 ~]#pt-mysql-summary --user=pt --password='pt' --port=3308 -S /data56m1/mysql3308.sock
Warning: Using a password on the command line interface can be insecure.
# Percona Toolkit MySQL Summary Report #######################
System time | 2013-11-07 03:38:14 UTC (local TZ: CST -0600)
(1)第一部分实例信息,有个参数需要特别注意、Time 指的是MySQL 服务器的当前时间、而不是MySQL 服务器所在的系统的时间
(2)第二部分是从show full processlist;中来的信息,对每一列进行了一些分析统计。
Command COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
Binlog Dump 1 1 1750000 1750000
Connect 2 2 2000000 1750000
Query 1 1 0 0
User COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
pt 1 1 0 0
repl 1 1 1750000 1750000
system user 2 2 2000000 1750000
Host COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
2 2 2000000 1750000
472322-esxapp16.ea.com 1 1 1750000 1750000
localhost 1 1 0 0
db COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
NULL 4 4 3500000 1750000
State COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
init 1 1 0 0
Master has sent all binlog to 1 1 1750000 1750000
Slave has read all relay log; 1 1 175000 175000
Waiting for master to send eve 1 1 1750000 1750000
(3)第三部分是从取自 show global status 、仅收集哪些变化的量,比较有价值的应该是第三列Per day Per second、取自两张快照、除以变化量、算出每秒的变化
# Status Counters (Wait 10 Seconds) ##########################
Variable Per day Per second 11 secs
Bytes_received 3000 350
Bytes_sent 7000 2000
Com_select 1 1
Com_set_option 2
Connections 1 1
Created_tmp_disk_tables 1
Created_tmp_tables 3 5
Handler_commit 1
Handler_external_lock 6
Handler_prepare 1
Handler_read_rnd_next 40 35
Handler_write 35 35
Innodb_buffer_pool_bytes_data 125000 1
Innodb_buffer_pool_pages_flushed 10
Innodb_buffer_pool_read_requests 125
Innodb_buffer_pool_reads 3
Innodb_buffer_pool_write_requests 60
Innodb_data_fsyncs 5
Innodb_data_read 125000 1
Innodb_data_reads 5
Innodb_data_writes 9
Innodb_data_written 400000 4
Innodb_dblwr_pages_written 10
Innodb_log_write_requests 9
Innodb_log_writes 1
Innodb_os_log_fsyncs 1
Innodb_os_log_written 5000
Innodb_pages_created 3
Innodb_pages_read 3
Innodb_pages_written 10
Innodb_available_undo_logs 2
Open_table_definitions 1
Opened_files 9 4
Opened_table_definitions 1
Opened_tables 2
Qcache_not_cached 1 1
Queries 10 3
Questions 9 3
Select_scan 2
Slave_received_heartbeats 45
Table_locks_immediate 3
Table_open_cache_hits 3
Table_open_cache_misses 1
Uptime 90000 1 1
(4)第四部分显示表缓存的大小、Usage表示在用的百分比,是一个比较近似的值。
# Table cache ################################################
Size | 2000
Usage | 4%
(5)第五部分显示安装的产品的特性。
# Key Percona Server features ################################
Table & Index Stats | Not Supported
Multiple I/O Threads | Enabled
Corruption Resilient | Not Supported
Durable Replication | Not Supported
Import InnoDB Tables | Not Supported
Fast Server Restarts | Not Supported
Enhanced Logging | Not Supported
Replica Perf Logging | Disabled
Response Time Hist. | Not Supported
Smooth Flushing | Not Supported
HandlerSocket NoSQL | Not Supported
Fast Hash UDFs | Unknown
# Percona XtraDB Cluster #####################################
(6)第六部分显示当前的插件以及状态。
# Plugins ####################################################
InnoDB compression | ACTIVE
(7)第七部分显示Query cache的参数值以及命中率。
# Query cache ################################################
query_cache_type | OFF
Size | 1.0M
Usage | 1%
HitToInsertRatio | 0%
# Schema #####################################################
(8)第八部分显示当前db下需要关注的一些点,比如SSL,Delayed Insert等。
Would you like to mysqldump -d the schema and analyze it? y/n n
Skipping schema analysis
# Noteworthy Technologies ####################################
SSL | No
Explicit LOCK TABLES | No
Delayed Insert | No
XA Transactions | No
NDB Cluster | No
Prepared Statements | No
Prepared statement count | 0
# InnoDB #####################################################
# MyISAM #####################################################
Key Cache | 8.0M
Pct Used | 20%
Unflushed | 0%
# Security ###################################################
Users | 9 users, 2 anon, 6 w/o pw, 6 old pw
Old Passwords | 0
# Binary Logging #############################################
Binlogs | 4
Zero-Sized | 0
Total Size | 1.2M
binlog_format | MIXED
expire_logs_days | 0
sync_binlog | 0
server_id | 11
binlog_do_db |
binlog_ignore_db |
(9)第九部分显示当前的一些buffer参数值。
# Noteworthy Variables #######################################