pt-mysql-summary
pt-mysql-summary主要用来输出MySQL的基本信息,可以作为数据库巡检以及刚开始熟悉数据库环境时候进行使用:
[root@mxqmongodb2 bin]# ./pt-mysql-summary --host=172.16.16.35 --port=3306 --user=root --password=123456 mysql: [Warning] Using a password on the command line interface can be insecure. # Percona Toolkit MySQL Summary Report ####################### System time | 2017-06-23 09:09:26 UTC (local TZ: CST +0800) # Instances ################################################## Port Data Directory Nice OOM Socket ===== ========================== ==== === ====== # MySQL Executable ########################################### # Report On Port 3306 ######################################## User | root@% Time | 2017-06-23 17:09:26 (CST) Hostname | mxqmongodb2 Version | 5.7.14-log MySQL Community Server (GPL) Built On | linux-glibc2.5 x86_64 Started | 2017-06-13 16:54 (up 10+00:15:23) Databases | 14 Datadir | /home/mysql/db3306/data/ Processes | 5 connected, 3 running Replication | Is not a slave, has 2 slaves connected Pidfile | /home/mysql/db3306/tmp/mysqld.pid (exists) # Processlist ################################################ Command COUNT(*) Working SUM(Time) MAX(Time) ------------------------------ -------- ------- --------- --------- Binlog Dump GTID 2 2 1750000 900000 Query 1 1 0 0 Sleep 2 0 2250 2250 User COUNT(*) Working SUM(Time) MAX(Time) ------------------------------ -------- ------- --------- --------- root 5 3 1750000 900000 Host COUNT(*) Working SUM(Time) MAX(Time) ------------------------------ -------- ------- --------- --------- 172.16.16.34 1 1 900000 900000 172.16.16.35 4 2 900000 900000 db COUNT(*) Working SUM(Time) MAX(Time) ------------------------------ -------- ------- --------- --------- NULL 3 3 1750000 900000 test 1 0 0 0 tpcc 1 0 0 0 State COUNT(*) Working SUM(Time) MAX(Time) ------------------------------ -------- ------- --------- --------- 2 0 0 0 Master has sent all binlog to 2 2 1750000 900000 starting 1 1 0 0 # Status Counters (Wait 10 Seconds) ########################## Variable Per day Per second 10 secs Aborted_clients 20 Aborted_connects 2 Binlog_cache_disk_use 800 Binlog_cache_use 35000 1 Binlog_stmt_cache_use 20 Bytes_received 300000000 3500 600 Bytes_sent 2250000000 25000 6000 Com_admin_commands 3000 1 Com_alter_table 2 Com_change_db 1250000 15 Com_commit 40000 Com_create_index 1 Com_create_table 4 Com_create_trigger 2 Com_delete 10000 Com_drop_table 3 Com_drop_trigger 2 Com_insert 600000 7 Com_insert_select 800 Com_kill 1 Com_rollback 1750000 20 Com_select 2500000 30 1 Com_set_option 8000 Com_show_create_table 20 Com_show_databases 4 Com_show_engine_status 4 Com_show_fields 15 Com_show_grants 1500 Com_show_master_status 2500 1 Com_show_processlist 2500 Com_show_slave_status 2500 1 Com_show_status 800 Com_show_storage_engines 4 Com_show_table_status 10 Com_show_tables 15 Com_show_triggers 2 Com_show_variables 5000 Com_show_warnings 800 Com_stmt_execute 4000000 45 Com_stmt_close 3000 Com_stmt_prepare 3500 Com_update 900000 10 1 Connections 1750 1 Created_tmp_disk_tables 35 1 Created_tmp_files 1 Created_tmp_tables 8000 6 Handler_commit 5000000 60 2 Handler_delete 9000 Handler_external_lock 10000000 125 2 Handler_prepare 1750000 20 2 Handler_read_first 15 Handler_read_key 4500000 50 1 Handler_read_next 45000000 500 Handler_read_rnd 90000 1 Handler_read_rnd_next 6000000 70 80 Handler_rollback 1750000 20 Handler_update 250000 2 1 Handler_write 4500000 50 40 Innodb_buffer_pool_bytes_data 12500000 125 Innodb_buffer_pool_bytes_dirty 350000 4 10000 Innodb_buffer_pool_pages_flushed 125000 1 Innodb_buffer_pool_read_ahead 80000 Innodb_buffer_pool_read_ahead_evicted 1750 Innodb_buffer_pool_read_requests 80000000 1000 35 Innodb_buffer_pool_reads 300000 3 Innodb_buffer_pool_wait_free 3000 Innodb_buffer_pool_write_requests 4500000 50 30 Innodb_data_fsyncs 30000 1 Innodb_data_read 6000000000 70000 3500 Innodb_data_reads 400000 4 Innodb_data_writes 150000 1 1 Innodb_data_written 5000000000 60000 2000 Innodb_dblwr_pages_written 125000 1 Innodb_dblwr_writes 3500 Innodb_log_write_requests 1000000 15 1 Innodb_log_writes 17500 1 Innodb_os_log_fsyncs 17500 1 Innodb_os_log_written 500000000 6000 2000 Innodb_pages_created 35000 Innodb_pages_read 400000 4 Innodb_pages_written 125000 1 Innodb_row_lock_time 15000000 175 Innodb_row_lock_waits 8000 Innodb_rows_deleted 9000 Innodb_rows_inserted 1500000 15 4 Innodb_rows_read 45000000 500 5 Innodb_rows_updated 250000 2 1 Innodb_num_open_files 4 Innodb_available_undo_logs 15 Key_read_requests 15 Key_reads 1 Key_write_requests 1 Open_table_definitions 25 Opened_files 250 Opened_table_definitions 70 Opened_tables 600 Qcache_not_cached 2500000 30 1 Queries 7000000 80 8 Questions 7000000 80 7 Rpl_semi_sync_master_no_tx 3 Select_range 2500 Select_scan 10000 Slow_queries 7000000 80 8 Sort_range 6000 Sort_rows 25000 Table_locks_immediate 6000 Table_open_cache_hits 5000000 60 1 Table_open_cache_misses 600 Table_open_cache_overflows 225 Threads_created 90 Uptime 90000 1 1 # Table cache ################################################ Size | 2000 Usage | 90% # 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 ##################################### # Plugins #################################################### InnoDB compression | ACTIVE # Query cache ################################################ query_cache_type | OFF Size | 1.0M Usage | 1% HitToInsertRatio | 0% # Semisynchronous Replication ################################ Master | Disabled Slave | Disabled # Schema ##################################################### Specify --databases or --all-databases to dump and summarize schemas # Noteworthy Technologies #################################### SSL | No Explicit LOCK TABLES | No Delayed Insert | No XA Transactions | No NDB Cluster | No Prepared Statements | Yes Prepared statement count | 0 # InnoDB ##################################################### Version | 5.7.14 Buffer Pool Size | 128.0M Buffer Pool Fill | 90% Buffer Pool Dirty | 2% File Per Table | ON Page Size | 16k Log File Size | 2 * 48.0M = 96.0M Log Buffer Size | 16M Flush Method | Flush Log At Commit | 1 XA Support | ON Checksums | ON Doublewrite | ON R/W I/O Threads | 4 4 I/O Capacity | 200 Thread Concurrency | 0 Concurrency Tickets | 5000 Commit Concurrency | 0 Txn Isolation Level | REPEATABLE-READ Adaptive Flushing | ON Adaptive Checkpoint | Checkpoint Age | 698k InnoDB Queue | 0 queries inside InnoDB, 0 queries in queue Oldest Transaction | 0 Seconds History List Len | 2159 Read Views | 0 Undo Log Entries | 0 transactions, 0 total undo, 0 max undo Pending I/O Reads | 0 buf pool reads, 0 normal AIO, 0 ibuf AIO, 0 preads Pending I/O Writes | 0 buf pool (0 LRU, 0 flush list, 0 page); 0 AIO, 0 sync, 0 log IO (0 log, 0 chkp); 0 pwrites Pending I/O Flushes | 0 buf pool, 0 log Transaction States | 4xnot started # MyISAM ##################################################### Key Cache | 8.0M Pct Used | 20% Unflushed | 0% # Security ################################################### Users | Old Passwords | 0 # Binary Logging ############################################# Binlogs | 8 Zero-Sized | 0 Total Size | 4.8G binlog_format | ROW expire_logs_days | 7 sync_binlog | 1 server_id | 353306 binlog_do_db | binlog_ignore_db | # Noteworthy Variables ####################################### Auto-Inc Incr/Offset | 1/1 default_storage_engine | InnoDB flush_time | 0 init_connect | init_file | sql_mode | NO_ENGINE_SUBSTITUTION join_buffer_size | 256k sort_buffer_size | 256k read_buffer_size | 128k read_rnd_buffer_size | 256k bulk_insert_buffer | 0.00 max_heap_table_size | 16M tmp_table_size | 16M max_allowed_packet | 4M thread_stack | 256k log | log_error | /home/mysql/db3306/log/mysql-error.log log_warnings | 2 log_slow_queries | log_queries_not_using_indexes | ON log_slave_updates | ON # Configuration File ######################################### Config File | /etc/my.cnf [client] port = 3306 socket = /home/mysql/db3306/tmp/mysql.sock # The End ####################################################
热衷于学习讨论MySQL和SQL Server,NoSQL等数据库技术,欢迎加入SQL优化群:659336691