pt-diskstats

NAME

pt-diskstats - Aggregate and summarize /proc/diskstats.

SYNOPSIS

Usage: pt-diskstats [OPTIONS] [FILES]

pt-diskstats reads /proc/diskstats periodically, or files with the contents of /proc/diskstats, aggregates the data, and prints it nicely.

RISKS

The following section is included to inform users about the potential risks, whether known or unknown, of using this tool. The two main categories of risks are those created by the nature of the tool (e.g. read-only tools vs. read-write tools) and those created by bugs.

pt-diskstats 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.

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 see a list of such issues at the following URL: http://www.percona.com/bugs/pt-diskstats.

See also “BUGS” for more information on filing bugs and getting help.

DESCRIPTION

pt-diskstats tool is similar to iostat, but has some advantages. It separates reads and writes, for example, and computes some things that iostat does in either incorrect or confusing ways. It is also menu-driven and interactive with several different ways to aggregate the data, and integrates well with the pt-collect tool. These properties make it very convenient for quickly drilling down into I/O performance at the desired level of granularity.

This program works in two main modes. One way is to process a file with saved disk statistics, which you specify on the command line. The other way is to start a background process gathering samples at intervals and saving them into a file, and process this file in the foreground. In both cases, the tool is interactively controlled by keystrokes, so you can redisplay and slice the data flexibly and easily. If the tool is not attached to a terminal, it doesn’t run interactively; it just processes and prints its output, then exits. Otherwise it loops until you exit with the ‘q’ key.

If you press the ‘?’ key, you will bring up the interactive help menu that shows which keys control the program.

Files should have this format:

<contents of /proc/diskstats>
TS <timestamp>
<contents of /proc/diskstats>
... et cetera
TS <timestamp>  <-- must end with a TS line.

See http://aspersa.googlecode.com/svn/html/diskstats.html for a detailed example of using the tool.

OUTPUT

The columns are as follows:

#ts

The number of seconds of samples in the line. If there is only one, then the timestamp itself is shown, without the {curly braces}.

device

The device name. If there is more than one device, then instead the number of devices aggregated into the line is shown, in {curly braces}.

rd_mb_s

The number of megabytes read per second, average, during the sampled interval.

rd_cnc

The average concurrency of the read operations, as computed by Little’s Law (a.k.a. queueing theory).

rd_rt

The average response time of the read operations, in milliseconds.

wr_mb_s

Megabytes written per second, average.

wr_cnc

Write concurrency, similar to read concurrency.

wr_rt

Write response time, similar to read response time.

busy

The fraction of time that the device had at least one request in progress; this is what iostat calls %util (which is a misleading name).

in_prg

The number of requests that were in progress. Unlike the read and write concurrencies, which are averages that are generated from reliable numbers, this number is an instantaneous sample, and you can see that it might represent a spike of requests, rather than the true long-term average.

In addition to the above columns, there are a few columns that are hidden by default. If you press the ‘c’ key, and then press Enter, you will blank out the regular expression pattern that selects columns to display, and you will then see the extra columns:

rd_s

The number of reads per second.

rd_avkb

The average size of the reads, in kilobytes.

rd_mrg

The percentage of read requests that were merged together in the disk scheduler before reaching the device.

wr_s, wr_avgkb, and wr_mrg

These are analogous to their rd_\* cousins.

OPTIONS

Options must precede files on the command line.

-c COLS Awk regex of which columns to include (default cnc|rt|mb|busy|prg).
-d DEVICES Awk regex of which devices to include.
-g GROUPBY

Group-by mode (default disk); specify one of the following:

disk   - Each line of output shows one disk device.
sample - Each line of output shows one sample of statistics.
all    - Each line of output shows one sample and one disk device.
-i INTERVAL In -g sample mode, include INTERVAL seconds per sample.
-k KEEPFILE File to save diskstats samples in (default /tmp/diskstats-samples). If a non-default filename is used, it will be saved for later analysis.
-n SAMPLES When in interactive mode, stop after N samples.
-s INTERVAL Sample /proc/diskstats every N seconds (default 1).

ENVIRONMENT

This tool does not use any environment variables.

SYSTEM REQUIREMENTS

This tool requires Bash v3 or newer and the /proc filesystem unless reading from files.

BUGS

For a list of known bugs, see http://www.percona.com/bugs/pt-diskstats.

Please report bugs at https://bugs.launchpad.net/percona-toolkit. Include the following information in your bug report:

* Complete command-line used to run the tool

* Tool “–version”

* MySQL version of all servers involved

* Output from the tool including STDERR

* Input files (log/dump/config files, etc.)

If possible, include debugging output by running the tool with PTDEBUG; see “ENVIRONMENT”.

DOWNLOADING

Visit http://www.percona.com/software/percona-toolkit/ to download the latest release of Percona Toolkit. Or, get the latest release from the command line:

wget percona.com/get/percona-toolkit.tar.gz

wget percona.com/get/percona-toolkit.rpm

wget percona.com/get/percona-toolkit.deb

You can also get individual tools from the latest release:

wget percona.com/get/TOOL

Replace TOOL with the name of any tool.

AUTHORS

Baron Schwartz

ABOUT PERCONA TOOLKIT

This tool is part of Percona Toolkit, a collection of advanced command-line tools developed by Percona for MySQL support and consulting. Percona Toolkit was forked from two projects in June, 2011: Maatkit and Aspersa. Those projects were created by Baron Schwartz and developed primarily by him and Daniel Nichter, both of whom are employed by Percona. Visit http://www.percona.com/software/ for more software developed by Percona.

VERSION

pt-diskstats 1.0.2

Percona Toolkit
Call Us
+1-888-316-9775 (USA - Sales)
+1-208-473-2904 (USA - Sales)
+44-208-133-0309 (UK - Sales)
0-800-051-8984 (UK - Sales)
0-800-181-0665 (GER - Sales)
+1-877-862-4316 (Emergency)
+1-855-55TRAIN (Training)
+1-925-271-5054 (Training)

Table Of Contents

Previous topic

pt-deadlock-logger

Next topic

pt-duplicate-key-checker

This Page



© Copyright 2011, Percona Inc.
Except where otherwise noted, this documentation is licensed under the following license:
CC Attribution-ShareAlike 2.0 Generic
Created using Sphinx 1.1.3.
This documentation is developed in Launchpad as part of the Percona Toolkit source code.
If you spotted innacuracies, errors, don't understood it or you think something is missing or should be improved, please file a bug.
]]>