pt-ioprofile

NAME

pt-ioprofile - Watch process IO and print a table of file and I/O activity.

SYNOPSIS

Usage

pt-ioprofile [OPTIONS] [FILE]

pt-ioprofile does two things: 1) get lsof+strace for -s seconds, 2) aggregate the result. If you specify a FILE, then step 1) is not performed.

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-ioprofile is a read-only tool, so your data is not at risk. However, it works by attaching strace to the process using ptrace(), which will make it run very slowly until strace detaches. In addition to freezing the server, there is also some risk of the process crashing or performing badly after strace detaches from it, or indeed of strace not detaching cleanly and leaving the process in a sleeping state. As a result, this should be considered an intrusive tool, and should not be used on production servers unless you are comfortable with that.

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-ioprofile.

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

DESCRIPTION

pt-ioprofile uses strace and lsof to watch a process’s IO and print out a table of files and I/O activity. By default, it watches the mysqld process for 30 seconds. The output is like:

Tue Dec 27 15:33:57 PST 2011
Tracing process ID 1833
     total       read      write      lseek  ftruncate filename
  0.000150   0.000029   0.000068   0.000038   0.000015 /tmp/ibBE5opS

You probably need to run this tool as root.

OPTIONS

--aggregate

short form: -a; type: string; default: sum

The aggregate function, either sum or avg.

If sum, then each cell will contain the sum of the values in it. If avg, then each cell will contain the average of the values in it.

--cell

short form: -c; type: string; default: times

The cell contents.

Valid values are:

VALUE  CELLS CONTAIN
=====  =======================
count  Count of I/O operations
sizes  Sizes of I/O operations
times  I/O operation timing
--group-by

short form: -g; type: string; default: filename

The group-by item.

Valid values are:

VALUE     GROUPING
=====     ======================================
all       Summarize into a single line of output
filename  One line of output per filename
pid       One line of output per process ID
--help

Print help and exit.

--profile-pid

short form: -p; type: int

The PID to profile, overrides --profile-process.

--profile-process

short form: -b; type: string; default: mysqld

The process name to profile.

--run-time

type: int; default: 30

How long to profile.

--save-samples

type: string

Filename to save samples in; these can be used for later analysis.

--version

Print the tool’s version and exit.

ENVIRONMENT

This tool does not use any environment variables.

SYSTEM REQUIREMENTS

This tool requires the Bourne shell (/bin/sh).

BUGS

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

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-ioprofile 2.0.5

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-index-usage

Next topic

pt-kill

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.
]]>