pt-mysql-summary 使用

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介: pt-mysql-summary 使用
[root@781c38071bbd ~]# pt-mysql-summary --host=172.17.0.2 --port=3306 --user=user0001 --password=User0001!
mysql: [Warning] Using a password on the command line interface can be insecure.
# Percona Toolkit MySQL Summary Report #######################
              System time | 2022-06-23 02:18:33 UTC (local TZ: UTC +0000)
# Instances ##################################################
  Port  Data Directory             Nice OOM Socket
  ===== ========================== ==== === ======
# MySQL Executable ###########################################
       Path to executable | /usr/sbin/mysqld
              Has symbols | Yes
# Slave Hosts ################################################
*************************** 1. row ***************************
 Server_id: 4
      Host:
      Port: 3306
 Master_id: 1
Slave_UUID: 5d939d06-ad4e-11ec-a3fd-fa163e102a2d
# Report On Port 3306 ########################################
                     User | user0001@%
                     Time | 2022-06-23 02:18:33 (UTC)
                 Hostname | 781c38071bbd
                  Version | 8.0.28 MySQL Community Server - GPL
                 Built On | Linux x86_64
                  Started | 2022-06-23 02:07 (up 0+00:10:38)
                Databases | 7
                  Datadir | /var/lib/mysql/
                Processes | 2 connected, 3 running
              Replication | Is not a slave, has 1 slaves connected
                  Pidfile | /var/run/mysqld/mysqld.pid (exists)
# Processlist ################################################

  Command                        COUNT(*) Working SUM(Time) MAX(Time)
  ------------------------------ -------- ------- --------- ---------
  Binlog Dump                           1       1       125       125
  Daemon                                1       1       600       600
  Query                                 1       1         0         0

  User                           COUNT(*) Working SUM(Time) MAX(Time)
  ------------------------------ -------- ------- --------- ---------
  event_scheduler                       1       1       600       600
  user0001                              2       2       125       125

  Host                           COUNT(*) Working SUM(Time) MAX(Time)
  ------------------------------ -------- ------- --------- ---------
  172.17.0.3                            1       1       125       125
  781c38071bbd                          1       1         0         0
  localhost                             1       1       600       600

  db                             COUNT(*) Working SUM(Time) MAX(Time)
  ------------------------------ -------- ------- --------- ---------
  NULL                                  3       3       800       600

  State                          COUNT(*) Working SUM(Time) MAX(Time)
  ------------------------------ -------- ------- --------- ---------
  init                                  1       1         0         0
  Source has sent all binlog to         1       1       125       125
  Waiting on empty queue                1       1       600       600

# Status Counters (Wait 10 Seconds) ##########################
Variable                                Per day  Per second     10 secs
Aborted_clients                             125
Bytes_received                           600000           6         600
Bytes_sent                          17500000000      225000        3000
Com_admin_commands                          250
Com_change_db                               125
Com_create_db                               125
Com_create_table                           4500
Com_flush                                   125
Com_select                                 2500                       2
Com_set_option                             1750
Com_show_master_status                      125
Com_show_replica_status                     125
Com_show_slave_status                       125
Com_show_status                             250
Com_show_variables                          400
Connections                                2250                       1
Created_tmp_disk_tables                     250
Created_tmp_files                           700
Created_tmp_tables                          900
Error_log_buffered_bytes                6000000          70
Error_log_buffered_events                 45000
Error_log_latest_write              225000000000000000 2500000000000
Flush_commands                              400
Handler_commit                            80000
Handler_external_lock                    800000           9           9
Handler_read_first                         6000
Handler_read_key                         225000           2           3
Handler_read_next                        500000           6           7
Handler_read_rnd_next                    500000           5         100
Handler_update                            45000
Handler_write                            150000           1          50
Innodb_buffer_pool_bytes_data        2500000000       30000       -1638
Innodb_buffer_pool_pages_flushed          25000
Innodb_buffer_pool_read_requests        2000000          25          20
Innodb_buffer_pool_reads                 125000           1
Innodb_buffer_pool_write_requests        250000           2           4
Innodb_data_fsyncs                         7000
Innodb_data_read                     2000000000       25000        1750
Innodb_data_reads                        125000           1
Innodb_data_writes                        30000
Innodb_data_written                   400000000        4500        1750
Innodb_dblwr_pages_written                 4000
Innodb_dblwr_writes                        1000
Innodb_log_write_requests                100000           1
Innodb_log_writes                          3000
Innodb_os_log_fsyncs                       2250
Innodb_os_log_written                   5000000          60
Innodb_pages_created                      20000
Innodb_pages_read                        125000           1
Innodb_pages_written                      25000
Innodb_rows_inserted                        700                       4
Innodb_rows_read                            700                       4
Innodb_system_rows_deleted                 2500
Innodb_system_rows_read                  700000           7          10
Innodb_system_rows_updated                45000
Innodb_num_open_files                      2500
Innodb_undo_tablespaces_total               250
Innodb_undo_tablespaces_implicit            250
Innodb_undo_tablespaces_active              250
Mysqlx_port                             4500000          50
Mysqlx_ssl_ctx_verify_mode                  700
Mysqlx_worker_threads                       250
Open_table_definitions                     6000
Opened_files                                400
Opened_table_definitions                  10000
Opened_tables                             22500                       2
Performance_schema_session_connect_attrs_longest_seen       22500
Queries                                    6000                       5
Questions                                  6000                       5
Select_scan                                1750
Ssl_accepts                                 800                       1
Ssl_finished_accepts                        800                       1
Table_locks_immediate                       700
Table_open_cache_hits                    400000           4           2
Table_open_cache_misses                   22500                       2
Threads_created                             250
Uptime                                    90000           1           1
# Table cache ################################################
                     Size | 4000
                    Usage | 2%
# 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 #####################################
mysql: [Warning] Using a password on the command line interface can be insecure.
# Plugins ####################################################
       InnoDB compression | ACTIVE
# Schema #####################################################
Specify --databases or --all-databases to dump and summarize schemas
# Noteworthy Technologies ####################################
                      SSL | Yes
     Explicit LOCK TABLES | No
           Delayed Insert | No
          XA Transactions | No
              NDB Cluster | No
      Prepared Statements | No
 Prepared statement count | 0
# InnoDB #####################################################
                  Version | 8.0.28
         Buffer Pool Size | 128.0M
         Buffer Pool Fill | 15%
        Buffer Pool Dirty | 0%
           File Per Table | ON
                Page Size | 16k
            Log File Size | 2 * 48.0M = 96.0M
          Log Buffer Size | 16M
             Flush Method | fsync
      Flush Log At Commit | 1
               XA Support |
                Checksums |
              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 |
        Adaptive Flushing | ON
      Adaptive Checkpoint |
           Checkpoint Age | 0
             InnoDB Queue | 0 queries inside InnoDB, 0 queries in queue
       Oldest Transaction | 0 Seconds
         History List Len | 0
               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 | 3xnot started
# MyISAM #####################################################
                Key Cache | 8.0M
                 Pct Used | 20%
                Unflushed | 0%
# Security ###################################################
                    Users | 2 users, 0 anon, 0 w/o pw, 0 old pw
            Old Passwords |
# Encryption #################################################
mysql: [Warning] Using a password on the command line interface can be insecure.
No keyring plugins found
# Binary Logging #############################################
                  Binlogs | 9
               Zero-Sized | 0
               Total Size | 129.1M
            binlog_format | ROW
         expire_logs_days | 0
              sync_binlog | 1
                server_id | 1
             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 | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,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 | 64M
             thread_stack | 1M
                      log |
                log_error | /var/log/mysqld.log
             log_warnings |
         log_slow_queries |
log_queries_not_using_indexes | OFF
        log_slave_updates | ON
# Configuration File #########################################
              Config File | /etc/my.cnf

[mysqld]
datadir                             = /var/lib/mysql
socket                              = /var/lib/mysql/mysql.sock
log-error                           = /var/log/mysqld.log
pid-file                            = /var/run/mysqld/mysqld.pid
server-id                           = 1
secure-file-priv                    = NULL
gtid_mode                           = off
enforce_gtid_consistency            = off
default_authentication_plugin       = mysql_native_password
# Memory management library ##################################
jemalloc is not enabled in mysql config for process with id 11018
# The End ####################################################
相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
5月前
|
关系型数据库 MySQL
925. 【mysql】convert 函数
925. 【mysql】convert 函数
68 3
|
2天前
|
存储 关系型数据库 MySQL
MySQL中利用FIND_IN_SET进行包含查询的技巧
`FIND_IN_SET`提供了一种简便的方法来执行包含查询,尤其是当数据以逗号分隔的字符串形式存储时。虽然这个方法的性能可能不如使用专门的关系表,但在某些场景下,它提供了快速简便的解决方案。开发者应该根据具体的应用场景和性能要求,权衡其使用。
8 0
|
关系型数据库 MySQL 数据库
MySQL中find_in_set函数的使用
1.语法 FIND_IN_SET(str,strlist) (1)str 要查询的字符串 (2)strlist 字段名; 参数以”,”分隔 如 (1,2,6,8) 查询字段(strlist)中包含(str)的结果,返回结果为null或记录 假如字符串str在由N个子链组成的字符串列表strlist 中,则返回值的范围在 1 到 N 之间。 一个字符串列表就是一个由一些被 ‘,’ 符号分开的子链组成的字符串。如果第一个参数是一个常数字符串,而第二个是type SET列,则FIND_IN_SET() 函数被优化,使用比特计算。 如果str不在strlist 或strlist 为空字符串,则返回
707 0
MySQL中find_in_set函数的使用
|
存储 关系型数据库 MySQL
【mysql】SET类型
【mysql】SET类型
410 0
【mysql】SET类型
|
存储 关系型数据库 MySQL
mysql中FIND_IN_SET和like的区别
在数据库中新建一张测试表t_user,包含三个字段'id','name','grilfriend',字段很容易看出,这是记录一个人的女朋友的表,注意这里的‘firlfriend’字段可以是多个人名,之间用逗号分开,如‘杨幂01,杨幂02’;这样的数据存储我们也经常见到。
261 0
mysql中FIND_IN_SET和like的区别
|
关系型数据库 MySQL
mysql find_in_set() 函数使用
mysql find_in_set() 函数使用
175 0
|
SQL 关系型数据库 MySQL
MySQL的find_in_set()函数
今天发现开发写的SQL中包含了find_in_set(),从来没见过,貌似挺有用的,了解一下
1758 0
|
SQL 监控 关系型数据库
|
关系型数据库 MySQL 索引