Percona Toolkit Study (ii) (Pt-config-diff,pt-deadlock-logger,pt-diskstats)

Source: Internet
Author: User
Tags percona

Pt-config-diff

Compare MySQL configuration files and server parameters

Example:

PT-CONFIG-DIFF/ETC/MY.CNF h=192.168.53.11--user=root--password=123456--socket=/tmp/mysql.sockpt-config-dirr/etc /my.cnf/etc/my_slave.cnf

The contents are as follows:

21 config differencesvariable                   /etc/my.cnf                      m11========================= ==== =========================== ===================event_scheduler            OFF                              onexpire_logs_ days          21                                14innodb_io_capacity        1200                              800innodb_max_dirty_pages... 75                                70innodb_thread_concurrency 26                                50join_buffer_size          8388608                           4194304key_buffer_size            16777216                         33554432max_connections            350                              450query_cache_limit          4194304                           2097152query_cache_size          201326592                         157286400read_buffer_size          8388608                           4194304read_rnd_buffer_size      8388608                           4194304relay_log                  12-relay-bin                relay_log_index          2-relay-bin.index          server_id                  2                                 1slave_skip_errors          1007,1008,1051,1062,1109,115... offsocket                     /tmp/mysql.sock                  /var/tmp/mysql.socksort_buffer_size           8388608                          4194304table_open_cache           500                               750thread_cache_size         36                                60tmp_table_size            16777216                          25165824


Pt-deadlock-logger

Logs information about the MySQL deadlock.

Mysql:show engine InnoDB status can only view the last deadlock information.

Parameter:--create-dest-table: creates the specified table. --dest: Creates a table that stores the deadlock information. --database:-D, which specifies the linked database. --table:-T, specifying the stored table name. --log: Specifies that deadlock log information is written to the file. --run-time: Run times, default permanent--interval: Run interval, default 30s. U,p,h,p: Link Database information.


Example: Pt-deadlock-logger--ask-pass--run-time=10--interval=3--create-dest-table--dest D=test,t=deadlocks u=root,P= 3306,h=127.0.0.1


After you execute this command, you can query the lock table information through select in the Mysql,test library.

Example: Pt-deadlock-logger--ask-pass--run-time=10--interval=3--log= '/tmp/deadlock.log ' u=root,P=3306,h=127.0.0.1


Pt-diskstats:

Function: View server's iousage: pt-diskstats [options] [files]options:  --columns-regex=s     Print columns that match this Perl regex  (default .)   --config=A           Read this  comma-separated list of config files; if                        specified,  this must be the first option on the command                         line  --devices-regex=s    print devices that match  this Perl regex  --group-by=s          Group-by mode: disk, sample, or all  (Default all)   --headers=H           if group is present, each sample will be  separated by a                        blank line, unless the sample  is only one line  (default                        group,scroll)   - -interval=i         when in interactive mode,  wait N seconds before printing                        to the screen   (default 1)   --iterations=i       when in interactive mode, stop  after n samples  --sample-time=i      in -- group-by sample mode, include n seconds of samples                         per group  (default 1)   --save-samples=s     File  to save diskstats samples in; these can be used for                         later analysis  --show-inactive      Show  inactive devices  --show-timestamps    show a  ' HH:MM:SS '   Timestamp in the  #ts  columnoption types: s=string, i=integer, f=float, h/h/a/a=comma-separated  list, d=dsn, z=size, m=timerules:  this tool accepts additional  command-line arguments. Refer to the SYNOPSIS and usage  Information for details. options and values after processing arguments:  --columns-regex       .  --config              /etc/percona-toolkit/percona-toolkit.conf,/etc/percona-toolkit/pt-diskstats.conf,/root/. percona-toolkit.conf,/root/.pt-diskstats.conf  --devices-regex       ( No value)   --group-by           all   --headers            group,scroll   --help               true   --interval           1  -- iterations          (No value)   --sample-time         1  --save-samples         (No value)   --show-inactive      false  -- show-timestamps    false  --version             false  --version-check      true
Example 1:pt-diskstats--interval=5--show-timestamps--columns-regex=wr* Example 2:pt-diskstats--interval=5--show-timestamps-    The-columns-regex=rd* results are as follows: #ts device wr_s wr_avkb wr_mb_s WR_MRG WR_CNC wr_rt16:29:30 SDA 14.5 13.0 0.2 69% 0.0 0.416:29:30 Sda3 14.5 13.0 0.2 69% 0.0 0.4


This article is from the "tireless learning ..." Blog, be sure to keep this source http://jonyisme.blog.51cto.com/3690784/1758816

Percona Toolkit Study (ii) (Pt-config-diff,pt-deadlock-logger,pt-diskstats)

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.