From f707656deeb31654ee32377382bb58c9352d1d5b Mon Sep 17 00:00:00 2001 From: "baron@percona.com" <> Date: Thu, 29 Mar 2012 21:26:22 -0400 Subject: [PATCH 1/4] docs; small quoting fix --- bin/pt-summary | 217 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 199 insertions(+), 18 deletions(-) diff --git a/bin/pt-summary b/bin/pt-summary index 7daae402..545b2d5e 100755 --- a/bin/pt-summary +++ b/bin/pt-summary @@ -2097,16 +2097,14 @@ sigtrap() { local PTFUNCNAME=sigtrap; # Execute the program if it was not included from another file. This makes it # possible to include without executing, and thus test. -# Execute the program if it was not included from another file. -# This makes it possible to include without executing, and thus test. if [ "${0##*/}" = "$TOOL" ] \ || [ "${0##*/}" = "bash" -a "$_" = "$0" ]; then # Set up temporary dir. mk_tmpdir # Parse command line options. - parse_options $0 "$@" - usage_or_errors $0 + parse_options "$0" "$@" + usage_or_errors "$0" po_status=$? rm_tmpdir @@ -2125,7 +2123,7 @@ fi =head1 NAME -pt-summary - Summarize system information in a nice way. +pt-summary - Summarize system information nicely. =head1 SYNOPSIS @@ -2134,17 +2132,13 @@ Usage: pt-summary pt-summary conveniently summarizes the status and configuration of a server. It is not a tuning tool or diagnosis tool. It produces a report that is easy to diff and can be pasted into emails without losing the formatting. This -tool works well on Linux systems. +tool works well on many types of Unix systems. Download and run: wget http://percona.com/get/pt-summary bash ./pt-summary -Download and run in a single step: - - wget -O- http://percona.com/get/summary | bash - =head1 RISKS The following section is included to inform users about the potential risks, @@ -2154,8 +2148,7 @@ tools) and those created by bugs. pt-summary is a read-only tool. It should be very low-risk. -At the time of this release, we know of no bugs that could cause serious harm -to users. +At the time of this release, we know of no bugs that could harm users. The authoritative source for updated information is always the online issue tracking system. Issues that affect this tool will be marked as such. You can @@ -2172,6 +2165,194 @@ then runs Unix commands on these results to format them nicely. It works best when executed as a privileged user, but will also work without privileges, although some output might not be possible to generate without root. +=head1 OUTPUT + +Many of the outputs from this tool are deliberately rounded to show their +magnitude but not the exact detail. This is called fuzzy-rounding. The idea is +that it doesn't matter whether a particular counter is 918 or 921; such a small +variation is insignificant, and only makes the output hard to compare to other +servers. Fuzzy-rounding rounds in larger increments as the input grows. It +begins by rounding to the nearest 5, then the nearest 10, nearest 25, and then +repeats by a factor of 10 larger (50, 100, 250), and so on, as the input grows. + +The following is a simple report generated from a CentOS virtual machine, +broken into sections with commentary following each section. Some long lines +are reformatted for clarity when reading this documentation as a manual page in +a terminal. + + # Percona Toolkit System Summary Report ###################### + Date | 2012-03-30 00:58:07 UTC (local TZ: EDT -0400) + Hostname | localhost.localdomain + Uptime | 20:58:06 up 1 day, 20 min, 1 user, + load average: 0.14, 0.18, 0.18 + System | innotek GmbH; VirtualBox; v1.2 () + Service Tag | 0 + Platform | Linux + Release | CentOS release 5.5 (Final) + Kernel | 2.6.18-194.el5 + Architecture | CPU = 32-bit, OS = 32-bit + Threading | NPTL 2.5 + Compiler | GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-48). + SELinux | Enforcing + Virtualized | VirtualBox + +This section shows the current date and time, and a synopsis of the server and +operating system. + + # Processor ################################################## + Processors | physical = 1, cores = 0, virtual = 1, hyperthreading = no + Speeds | 1x2510.626 + Models | 1xIntel(R) Core(TM) i5-2400S CPU @ 2.50GHz + Caches | 1x6144 KB + +This section is derived from F. + + # Memory ##################################################### + Total | 503.2M + Free | 29.0M + Used | physical = 474.2M, swap allocated = 1.0M, + swap used = 16.0k, virtual = 474.3M + Buffers | 33.9M + Caches | 262.6M + Dirty | 396 kB + UsedRSS | 201.9M + Swappiness | 60 + DirtyPolicy | 40, 10 + Locator Size Speed Form Factor Type Type Detail + ======= ==== ===== =========== ==== =========== + +Information about memory is gathered from C. The Used statistic is the +total of the rss sizes displayed by C. The Dirty statistic for the cached +value comes from F. On Linux, the swappiness settings are +gathered from C. The final portion of this section is a table of the +DIMMs, which comes from C. In this example there is no output. + + # Mounted Filesystems ######################################## + Filesystem Size Used Type Opts Mountpoint + /dev/mapper/VolGroup00-LogVol00 15G 17% ext3 rw / + /dev/sda1 99M 13% ext3 rw /boot + tmpfs 252M 0% tmpfs rw /dev/shm + +The mounted filesystem section is a combination of information from C and +C. This section is skipped if you disable L<"--summarize-mounts">. + + # Disk Schedulers And Queue Size ############################# + dm-0 | UNREADABLE + dm-1 | UNREADABLE + hdc | [cfq] 128 + md0 | UNREADABLE + sda | [cfq] 128 + +The disk scheduler information is extracted from the F filesystem in +Linux. + + # Disk Partioning ############################################ + Device Type Start End Size + ============ ==== ========== ========== ================== + /dev/sda Disk 17179869184 + /dev/sda1 Part 1 13 98703360 + /dev/sda2 Part 14 2088 17059230720 + +Information about disk partitioning comes from C. + + # Kernel Inode State ######################################### + dentry-state | 10697 8559 45 0 0 0 + file-nr | 960 0 50539 + inode-nr | 14059 8139 + +These lines are from the files of the same name in the F +directory on Linux. Read the C man page to learn about the meaning of +these files on your system. + + # LVM Volumes ################################################ + LV VG Attr LSize Origin Snap% Move Log Copy% Convert + LogVol00 VolGroup00 -wi-ao 269.00G + LogVol01 VolGroup00 -wi-ao 9.75G + +This section shows the output of C. + + # RAID Controller ############################################ + Controller | No RAID controller detected + +The tool can detect a variety of RAID controllers by examining C and +C information. If the controller software is installed on the system, in +many cases it is able to execute status commands and show a summary of the RAID +controller's status and configuration. If your system is not supported, please +file a bug report. + + # Network Config ############################################# + Controller | Intel Corporation 82540EM Gigabit Ethernet Controller + FIN Timeout | 60 + Port Range | 61000 + +The network controllers attached to the system are detected from C. The +TCP/IP protocol configuration parameters are extracted from C. You can skip this section by disabling the L<"--summarize-network"> option. + + # Interface Statistics ####################################### + interface rx_bytes rx_packets rx_errors tx_bytes tx_packets tx_errors + ========= ======== ========== ========= ======== ========== ========= + lo 60000000 12500 0 60000000 12500 0 + eth0 15000000 80000 0 1500000 10000 0 + sit0 0 0 0 0 0 0 + +Interface statistics are gathered from C and are fuzzy-rounded. The +columns are received and transmitted bytes, packets, and errors. You can skip +this section by disabling the L<"--summarize-network"> option. + + # Network Connections ######################################## + Connections from remote IP addresses + 127.0.0.1 2 + Connections to local IP addresses + 127.0.0.1 2 + Connections to top 10 local ports + 38346 1 + 60875 1 + States of connections + ESTABLISHED 5 + LISTEN 8 + +This section shows a summary of network connections, retrieved from C +and "fuzzy-rounded" to make them easier to compare when the numbers grow large. +There are two sub-sections showing how many connections there are per origin +and destination IP address, and a sub-section showing the count of ports in +use. The section ends with the count of the network connections' states. You +can skip this section by disabling the L<"--summarize-network"> option. + + # Top Processes ############################################## + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 1 root 15 0 2072 628 540 S 0.0 0.1 0:02.55 init + 2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0 + 3 root 34 19 0 0 0 S 0.0 0.0 0:00.03 ksoftirqd/0 + 4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0 + 5 root 10 -5 0 0 0 S 0.0 0.0 0:00.97 events/0 + 6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper + 7 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread + 10 root 10 -5 0 0 0 S 0.0 0.0 0:00.13 kblockd/0 + 11 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid + # Notable Processes ########################################## + PID OOM COMMAND + 2028 +0 sshd + +This section shows the first few lines of C so that you can see what +processes are actively using CPU time. The notable processes include the SSH +daemon and any process whose out-of-memory-killer priority is set to 17. You +can skip this section by disabling the L<"--summarize-processes"> option. + + # Simplified and fuzzy rounded vmstat (wait please) ########## + procs ---swap-- -----io---- ---system---- --------cpu-------- + r b si so bi bo ir cs us sy il wa st + 2 0 0 0 3 15 30 125 0 0 99 0 0 + 0 0 0 0 0 0 1250 800 6 10 84 0 0 + 0 0 0 0 0 0 1000 125 0 0 100 0 0 + 0 0 0 0 0 0 1000 125 0 0 100 0 0 + 0 0 0 0 0 450 1000 125 0 1 88 11 0 + # The End #################################################### + +This section is a trimmed-down sample of C, so you can see the +general status of the system at present. The values in the table are +fuzzy-rounded, except for the CPU columns. You can skip this section by +disabling the L<"--summarize-processes"> option. + =head1 OPTIONS =over @@ -2191,37 +2372,37 @@ Print help and exit. type: string -Save the data files used to generate the summary in this directory. +Save the collected data in this directory. =item --read-samples type: string -Create a report from the files found in this directory. +Create a report from the files in this directory. =item --summarize-mounts default: yes; negatable: yes -Whenever the tool summarizes mounted filesystems and disk fullness. +Report on mounted filesystems and disk usage. =item --summarize-network default: yes; negatable: yes -Whenever the tool prints information on network controllers & config. +Report on network controllers and configuration. =item --summarize-processes default: yes; negatable: yes -Whenever the tool summarizes the top processes and vmstat information. +Report on top processes and C output. =item --sleep type: int; default: 5 -How much time to sleep when gathering samples from vmstat. +How long to sleep when gathering samples from vmstat. =item --version From 3f668362e7b0c988b2d6d181a7eab6990996e470 Mon Sep 17 00:00:00 2001 From: "baron@percona.com" <> Date: Thu, 29 Mar 2012 21:39:31 -0400 Subject: [PATCH 2/4] fix a few bugs --- bin/pt-summary | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/bin/pt-summary b/bin/pt-summary index 545b2d5e..cdfb55c8 100755 --- a/bin/pt-summary +++ b/bin/pt-summary @@ -842,7 +842,7 @@ linux_exclusive_collection () { local PTFUNCNAME=linux_exclusive_collection; echo "threading $(getconf GNU_LIBPTHREAD_VERSION)" >> "$data_dir/summary" local getenforce="" - [ "$CMD_GETENFORCE" ] && $CMD_GETENFORCE 2>&1 + [ "$CMD_GETENFORCE" ] && getenforce="$($CMD_GETENFORCE 2>&1)" echo "getenforce ${getenforce:-"No SELinux detected"}" >> "$data_dir/summary" echo "swappiness $(awk '/vm.swappiness/{print $3}' "$data_dir/sysctl")" >> "$data_dir/summary" @@ -1692,30 +1692,11 @@ parse_lsi_megaraid_bbu_status () { local PTFUNCNAME=parse_lsi_megaraid_bbu_statu } format_lvs () { local PTFUNCNAME=format_lvs; - local lvs_file="$1" - local vgs_file="$2" - - if [ -e "$lvs_file" -a -e "$vgs_file" ]; then - local header="$(head -n1 "$lvs_file")$(head -n1 "$vgs_file" | sed -e 's/^ *VG//')" - - echo "$header" - tail -n+2 "$lvs_file" | while read lvs_line; do - local current_vg="$(echo $lvs_line | awk '{print $2}')" - while read vgs_line; do - local current_vgs_vg="$(echo $vgs_line | awk '{print $1}' )" - if [ "$current_vg" = "$current_vgs_vg" ]; then - lvs_line="${lvs_line}$(echo $vgs_line | sed -e "s/^ *$current_vg//")" - break - fi - done < "$vgs_file" - echo $lvs_line - done + local file="$1" + if [ -e "$file" ]; then + grep -v "open failed" "$file" else - if [ -e "$lvs_file" ]; then - cat "$lvs_file" - else - echo "Cannot execute 'lvs'"; - fi + echo "Unable to collect information"; fi } @@ -1988,7 +1969,9 @@ report_system_summary () { local PTFUNCNAME=report_system_summary; done section "LVM_Volumes" - format_lvs "$data_dir/lvs" "$data_dir/vgs" + format_lvs "$data_dir/lvs" + section "LVM_Volume_Groups" + format_lvs "$data_dir/vgs" fi section "RAID_Controller" From 8e4d1fe005acd34effbd693daec9f08fef15ea7f Mon Sep 17 00:00:00 2001 From: "baron@percona.com" <> Date: Fri, 30 Mar 2012 15:34:28 -0400 Subject: [PATCH 3/4] docs and a few tweaks --- bin/pt-mysql-summary | 399 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 381 insertions(+), 18 deletions(-) diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index fcff7af0..0e586a6e 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -1845,7 +1845,7 @@ _semi_sync_stats_for () { trace_extra="Unknown setting" fi fi - + name_val "${target} semisync status" "${semisync_status}" name_val "${target} trace level" "${semisync_trace}, ${trace_extra}" @@ -1911,9 +1911,9 @@ report_mysql_summary () { section Instances parse_mysqld_instances "$dir/mysqld-instances" "$dir/mysql-variables" - section MySQL_Executable - name_val "Path to executable" "$( get_var pt-summary-internal-mysql_executable "$dir/mysql-variables" )" - name_val "Has symbols" "$( get_var "pt-summary-internal-symbols" "$dir/mysql-variables" )" + # TODO section MySQL_Executable + # TODO name_val "Path to executable" "$( get_var pt-summary-internal-mysql_executable "$dir/mysql-variables" )" + # TODO name_val "Has symbols" "$( get_var "pt-summary-internal-symbols" "$dir/mysql-variables" )" local user="$(get_var "pt-summary-internal-user" "$dir/mysql-variables")" local port="$(get_var port "$dir/mysql-variables")" @@ -1969,6 +1969,7 @@ report_mysql_summary () { section_percona_server_features "$dir/mysql-variables" section Plugins + # TODO: what would be good is to show nonstandard plugins here. name_val "InnoDB compression" "$(get_plugin_status "$dir/mysql-plugins" "INNODB_CMP")" if [ "$(get_var have_query_cache "$dir/mysql-variables")" ]; then @@ -2054,6 +2055,12 @@ report_mysql_summary () { else name_val "Partitioning" "No" fi + if grep -e 'ENGINE=InnoDB.*ROW_FORMAT' \ + -e 'ENGINE=InnoDB.*KEY_BLOCK_SIZE' "$dir/mysqldump" > /dev/null; then + name_val "InnoDB Compression" "Yes" + else + name_val "InnoDB Compression" "No" + fi fi local ssl="$(get_var Ssl_accepts "$dir/mysql-status")" if [ -n "$ssl" -a "${ssl:-0}" -gt 0 ]; then @@ -2265,7 +2272,7 @@ fi =head1 NAME -pt-mysql-summary - Summarize MySQL information in a nice way. +pt-mysql-summary - Summarize MySQL information nicely. =head1 SYNOPSIS @@ -2286,8 +2293,7 @@ tools) and those created by bugs. pt-mysql-summary is a read-only tool. It should be very low-risk. -At the time of this release, we know of no bugs that could cause serious harm -to users. +At the time of this release, we know of no bugs that could harm users. The authoritative source for updated information is always the online issue tracking system. Issues that affect this tool will be marked as such. You can @@ -2303,30 +2309,387 @@ it for status and configuration information. It saves these bits of data into files in a temporary directory, and then formats them neatly with awk and other scripting languages. -To use, simply execute it. Optionally add the same command-line options -you would use to connect to MySQL, like C. +To use, simply execute it. Optionally add a double dash and then the same +command-line options you would use to connect to MySQL, such as the following: + + pt-mysql-summary -- --user=root The tool interacts minimally with the server upon which it runs. It assumes that you'll run it on the same server you're inspecting, and therefore it -assumes that it will be able to find the my.cnf configuration file, for -example. However, it should degrade gracefully if this is not the case. -Note, however, that its output does not indicate which information comes from -the MySQL database and which comes from the host operating system, so it is -possible for confusing output to be generated if you run the tool on one -server and direct it to connect to a MySQL database server running on another -server. +assumes that it will be able to find the my.cnf configuration file, for example. +However, it should degrade gracefully if this is not the case. Note, however, +that its output does not indicate which information comes from the MySQL +database and which comes from the host operating system, so it is possible for +confusing output to be generated if you run the tool on one server and connect +to a MySQL database server running on another server. -=head1 Fuzzy-Rounding +=head1 OUTPUT Many of the outputs from this tool are deliberately rounded to show their magnitude but not the exact detail. This is called fuzzy-rounding. The idea -is that it doesn't matter whether a server is running 918 queries per second +is that it does not matter whether a server is running 918 queries per second or 921 queries per second; such a small variation is insignificant, and only makes the output hard to compare to other servers. Fuzzy-rounding rounds in larger increments as the input grows. It begins by rounding to the nearest 5, then the nearest 10, nearest 25, and then repeats by a factor of 10 larger (50, 100, 250), and so on, as the input grows. +The following is a sample of the report that the tool produces: + + # Percona Toolkit MySQL Summary Report ####################### + System time | 2012-03-30 18:46:05 UTC + (local TZ: EDT -0400) + # Instances ################################################## + Port Data Directory Nice OOM Socket + ===== ========================== ==== === ====== + 12345 /tmp/12345/data 0 0 /tmp/12345.sock + 12346 /tmp/12346/data 0 0 /tmp/12346.sock + 12347 /tmp/12347/data 0 0 /tmp/12347.sock + +The first two sections show which server the report was generated on and which +MySQL instances are running on the server. This is detected from the output of +C and does not always detect all instances and parameters, but often works +well. From this point forward, the report will be focused on a single MySQL +instance, although several instances may appear in the above paragraph. + + # Report On Port 12345 ####################################### + User | msandbox@% + Time | 2012-03-30 14:46:05 (EDT) + Hostname | localhost.localdomain + Version | 5.5.20-log MySQL Community Server (GPL) + Built On | linux2.6 i686 + Started | 2012-03-28 23:33 (up 1+15:12:09) + Databases | 4 + Datadir | /tmp/12345/data/ + Processes | 2 connected, 2 running + Replication | Is not a slave, has 1 slaves connected + Pidfile | /tmp/12345/data/12345.pid (exists) + +This section is a quick summary of the MySQL instance: version, uptime, and +other very basic parameters. The Time output is generated from the MySQL server, +unlike the system date and time printed earlier, so you can see whether the +database and operating system times match. + + # Processlist ################################################ + + Command COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + Binlog Dump 1 1 150000 150000 + Query 1 1 0 0 + + User COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + msandbox 2 2 150000 150000 + + Host COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + localhost 2 2 150000 150000 + + db COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + NULL 2 2 150000 150000 + + State COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + Master has sent all binlog to 1 1 150000 150000 + NULL 1 1 0 0 + +This section is a summary of the output from SHOW PROCESSLIST. Each sub-section +is aggregated by a different item, which is shown as the first column heading. +When summarized by Command, every row in SHOW PROCESSLIST is included, but +otherwise, rows whose Command is Sleep are excluded from the SUM and MAX +columns, so they do not skew the numbers too much. In the example shown, the +server is idle except for this tool itself, and one connected replica, which +is executing Binlog Dump. + +The columns are the number of rows included, the number that are not in Sleep +status, the sum of the Time column, and the maximum Time column. The numbers are +fuzzy-rounded. + + # Status Counters (Wait 10 Seconds) ########################## + Variable Per day Per second 10 secs + Binlog_cache_disk_use 4 + Binlog_cache_use 80 + Bytes_received 15000000 175 200 + Bytes_sent 15000000 175 2000 + Com_admin_commands 1 + ...................(many lines omitted)............................ + Threads_created 40 1 + Uptime 90000 1 1 + +This section shows selected counters from two snapshots of SHOW GLOBAL STATUS, +gathered approximately 10 seconds apart and fuzzy-rounded. It includes only +items that are incrementing counters; it does not include absolute numbers such +as the Threads_running status variable, which represents a current value, rather +than an accumulated number over time. + +The first column is the variable name, and the second column is the counter from +the first snapshot divided by 86400 (the number of seconds in a day), so you can +see the magnitude of the counter's change per day. 86400 fuzzy-rounds to 90000, +so the Uptime counter should always be about 90000. + +The third column is the value from the first snapshot, divided by Uptime and +then fuzzy-rounded, so it represents approximately how quickly the counter is +growing per-second over the uptime of the server. + +The third column is the incremental difference from the first and second +snapshot, divided by the difference in uptime and then fuzzy-rounded. Therefore, +it shows how quickly the counter is growing per second at the time the report +was generated. + + # Table cache ################################################ + Size | 400 + Usage | 15% + +This section shows the size of the table cache, followed by the percentage of +the table cache in use. The usage is fuzzy-rounded. + + # 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 | Not Supported + Response Time Hist. | Not Supported + Smooth Flushing | Not Supported + HandlerSocket NoSQL | Not Supported + Fast Hash UDFs | Unknown + +This section shows features that are available in Percona Server and whether +they are enabled or not. In the example shown, the server is standard MySQL, not +Percona Server, so the features are generally not supported. + + # Plugins #################################################### + InnoDB compression | ACTIVE + +This feature shows specific plugins and whether they are enabled. + + # Query cache ################################################ + query_cache_type | ON + Size | 0.0 + Usage | 0% + HitToInsertRatio | 0% + +This section shows whether the query cache is enabled and its size, followed by +the percentage of the cache in use and the hit-to-insert ratio. The latter two +are fuzzy-rounded. + + # Schema ##################################################### + Would you like to mysqldump -d the schema and analyze it? y/n y + There are 4 databases. Would you like to dump all, or just one? + Type the name of the database, or press Enter to dump all of them. + + Database Tables Views SPs Trigs Funcs FKs Partn + mysql 24 + performance_schema 17 + sakila 16 7 3 6 3 22 + + Database MyISAM CSV PERFORMANCE_SCHEMA InnoDB + mysql 22 2 + performance_schema 17 + sakila 8 15 + + Database BTREE FULLTEXT + mysql 31 + performance_schema + sakila 63 1 + + c t s e l d i t m v s + h i e n o a n i e a m + a m t u n t t n d r a + r e m g e y i c l + s b t i u h l + t l i n m a i + a o m t t r n + m b e e t + p x + t + Database === === === === === === === === === === === + mysql 61 10 6 78 5 4 26 3 4 5 3 + performance_schema 5 16 33 + sakila 1 15 1 3 4 3 19 42 26 + +If you select to dump the schema and analyze it, the tool will print the above +section. This summarizes the number and type of objects in the database. It is +generated by running C, not by querying the +INFORMATION_SCHEMA, which can freeze a busy server. You can use the +L<"--databases"> option to specify which databases to examine. If you do not, +and you run the tool interactively, it will prompt you as shown. + +You can choose not to dump the schema, to dump all of the databases, or to dump +only a single named one, by specifying the appropriate options. In the example +above, we are dumping all databases. + +The first sub-report in the section is the count of objects by type in each +database: tables, views, and so on. The second one shows how many tables use +various storage engines in each database. The third sub-report shows the number +of each type of indexes in each database. + +The last section shows the number of columns of various data types in each +database. For compact display, the column headers are formatted vertically, so +you need to read downwards from the top. In this example, the first column is +C and the second column is C. This example is truncated so it +does not wrap on a terminal. + +All of the numbers in this portion of the output are exact, not fuzzy-rounded. + + # Noteworthy Technologies #################################### + Full Text Indexing | Yes + Geospatial Types | No + Foreign Keys | Yes + Partitioning | No + InnoDB Compression | Yes + SSL | No + Explicit LOCK TABLES | No + Delayed Insert | No + XA Transactions | No + NDB Cluster | No + Prepared Statements | No + Prepared statement count | 0 + +This section shows some specific technologies used on this server. Some of them +are detected from the schema dump performed for the previous sections; others +can be detected by looking at SHOW GLOBAL STATUS. + + # InnoDB ##################################################### + Version | 1.1.8 + Buffer Pool Size | 16.0M + Buffer Pool Fill | 100% + Buffer Pool Dirty | 0% + File Per Table | OFF + Page Size | 16k + Log File Size | 2 * 5.0M = 10.0M + Log Buffer Size | 8M + 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 | 500 + Commit Concurrency | 0 + Txn Isolation Level | REPEATABLE-READ + 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 | 209 + Read Views | 1 + Undo Log Entries | 1 transactions, 1 total undo, 1 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 | 1xnot started + +This section shows important configuration variables for the InnoDB storage +engine. The buffer pool fill percent and dirty percent are fuzzy-rounded. The +last few lines are derived from the output of SHOW INNODB STATUS. It is likely +that this output will change in the future to become more useful. + + # MyISAM ##################################################### + Key Cache | 16.0M + Pct Used | 10% + Unflushed | 0% + +This section shows the size of the MyISAM key cache, followed by the percentage +of the cache in use and percentage unflushed (fuzzy-rounded). + + # Security ################################################### + Users | 2 users, 0 anon, 0 w/o pw, 0 old pw + Old Passwords | OFF + +This section is generated from queries to tables in the mysql system database. +It shows how many users exist, and various potential security risks such as +old-style passwords and users without passwords. + + # Binary Logging ############################################# + Binlogs | 1 + Zero-Sized | 0 + Total Size | 21.8M + binlog_format | STATEMENT + expire_logs_days | 0 + sync_binlog | 0 + server_id | 12345 + binlog_do_db | + binlog_ignore_db | + +This section shows configuration and status of the binary logs. If there are +zero-sized binary logs, then it is possible that the binlog index is out of sync +with the binary logs that actually exist on disk. + + # Noteworthy Variables ####################################### + Auto-Inc Incr/Offset | 1/1 + default_storage_engine | InnoDB + flush_time | 0 + init_connect | + init_file | + sql_mode | + join_buffer_size | 128k + sort_buffer_size | 2M + 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 | 1M + thread_stack | 192k + log | OFF + log_error | /tmp/12345/data/mysqld.log + log_warnings | 1 + log_slow_queries | ON + log_queries_not_using_indexes | OFF + log_slave_updates | ON + +This section shows several noteworthy server configuration variables that might +be important to know about when working with this server. + + # Configuration File ######################################### + Config File | /tmp/12345/my.sandbox.cnf + [client] + user = msandbox + password = msandbox + port = 12345 + socket = /tmp/12345/mysql_sandbox12345.sock + [mysqld] + port = 12345 + socket = /tmp/12345/mysql_sandbox12345.sock + pid-file = /tmp/12345/data/mysql_sandbox12345.pid + basedir = /home/baron/5.5.20 + datadir = /tmp/12345/data + key_buffer_size = 16M + innodb_buffer_pool_size = 16M + innodb_data_home_dir = /tmp/12345/data + innodb_log_group_home_dir = /tmp/12345/data + innodb_data_file_path = ibdata1:10M:autoextend + innodb_log_file_size = 5M + log-bin = mysql-bin + relay_log = mysql-relay-bin + log_slave_updates + server-id = 12345 + report-host = 127.0.0.1 + report-port = 12345 + log-error = mysqld.log + innodb_lock_wait_timeout = 3 + # The End #################################################### + +This section shows a pretty-printed version of the my.cnf file, with comments +removed and with whitespace added to align things for easy reading. The tool +tries to detect the my.cnf file by looking at the output of ps, and if it does +not find the location of the file there, it tries common locations until it +finds a file. Note that this file might not actually correspond with the server +from which the report was generated. This can happen when the tool isn't run on +the same server it's reporting on, or when detecting the location of the +configuration file fails. + =head1 OPTIONS All options after -- are passed to C. From 6e9a483ee191a327b3a9e36979d0a2d5787ffbf7 Mon Sep 17 00:00:00 2001 From: "baron@percona.com" <> Date: Fri, 30 Mar 2012 15:46:14 -0400 Subject: [PATCH 4/4] more slight doc tweaks --- bin/pt-mysql-summary | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index 0e586a6e..3128d037 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -2723,10 +2723,9 @@ Create a report from the files found in this directory. type: string -Names of databases to dump through myslqdump. If you want all of them, -you can use --all-databases; you can also pass in a comma-separated list -of database names. If not provided, the program will ask you -for manual input. +Names of databases to summarize. If you want all of them, you can use the value +C<--all-databases>; you can also pass in a comma-separated list of database +names. If not provided, the program will ask you for manual input. =item --sleep