.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PT-IOPROFILE 1p" .TH PT-IOPROFILE 1p "2020-08-30" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" pt\-ioprofile \- Watch process IO and print a table of file and I/O activity. .SH "SYNOPSIS" .IX Header "SYNOPSIS" Usage: pt-ioprofile [\s-1OPTIONS\s0] [\s-1FILE\s0] .PP pt-ioprofile does two things: 1) get lsof+strace for \-s seconds, 2) aggregate the result. If you specify a \s-1FILE,\s0 then step 1) is not performed. .SH "RISKS" .IX Header "RISKS" \&\fB\s-1WARNING\s0\fR: pt-ioprofile freezes the server and may crash the process, or make it perform badly after detaching, or leave it in a sleeping state! Before using this tool, please: .IP "\(bu" 4 Read the tool's documentation .IP "\(bu" 4 Review the tool's known \*(L"\s-1BUGS\*(R"\s0 .IP "\(bu" 4 Test the tool on a non-production server .IP "\(bu" 4 Backup your production server and verify the backups .Sp pt-ioprofile should be considered an intrusive tool, and should not be used on production servers unless you understand and accept the risks. .SH "DESCRIPTION" .IX Header "DESCRIPTION" pt-ioprofile uses \f(CW\*(C`strace\*(C'\fR and \f(CW\*(C`lsof\*(C'\fR to watch a process's \s-1IO\s0 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: .PP .Vb 4 \& 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 .Ve .PP You probably need to run this tool as root. .PP pt-ioprofile works by attaching \f(CW\*(C`strace\*(C'\fR to the process using \f(CW\*(C`ptrace()\*(C'\fR, which will make it run very slowly until \f(CW\*(C`strace\*(C'\fR detaches. In addition to freezing the server, there is some risk of the process crashing or performing badly after \f(CW\*(C`strace\*(C'\fR detaches from it, or of \f(CW\*(C`strace\*(C'\fR 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. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\-\-aggregate" 4 .IX Item "--aggregate" short form: \-a; type: string; default: sum .Sp The aggregate function, either \f(CW\*(C`sum\*(C'\fR or \f(CW\*(C`avg\*(C'\fR. .Sp 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. .IP "\-\-cell" 4 .IX Item "--cell" short form: \-c; type: string; default: times .Sp The cell contents. .Sp Valid values are: .Sp .Vb 5 \& VALUE CELLS CONTAIN \& ===== ======================= \& count Count of I/O operations \& sizes Sizes of I/O operations \& times I/O operation timing .Ve .IP "\-\-group\-by" 4 .IX Item "--group-by" short form: \-g; type: string; default: filename .Sp The group-by item. .Sp Valid values are: .Sp .Vb 5 \& 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 .Ve .IP "\-\-help" 4 .IX Item "--help" Print help and exit. .IP "\-\-profile\-pid" 4 .IX Item "--profile-pid" short form: \-p; type: int .Sp The \s-1PID\s0 to profile, overrides \*(L"\-\-profile\-process\*(R". .IP "\-\-profile\-process" 4 .IX Item "--profile-process" short form: \-b; type: string; default: mysqld .Sp The process name to profile. .IP "\-\-run\-time" 4 .IX Item "--run-time" type: int; default: 30 .Sp How long to profile. .IP "\-\-save\-samples" 4 .IX Item "--save-samples" type: string .Sp Filename to save samples in; these can be used for later analysis. .IP "\-\-version" 4 .IX Item "--version" Print the tool's version and exit. .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" This tool does not use any environment variables. .SH "SYSTEM REQUIREMENTS" .IX Header "SYSTEM REQUIREMENTS" This tool requires the Bourne shell (\fI/bin/sh\fR). .SH "BUGS" .IX Header "BUGS" For a list of known bugs, see . .PP Please report bugs at . Include the following information in your bug report: .IP "\(bu" 4 Complete command-line used to run the tool .IP "\(bu" 4 Tool \*(L"\-\-version\*(R" .IP "\(bu" 4 MySQL version of all servers involved .IP "\(bu" 4 Output from the tool including \s-1STDERR\s0 .IP "\(bu" 4 Input files (log/dump/config files, etc.) .PP If possible, include debugging output by running the tool with \f(CW\*(C`PTDEBUG\*(C'\fR; see \*(L"\s-1ENVIRONMENT\*(R"\s0. .SH "DOWNLOADING" .IX Header "DOWNLOADING" Visit to download the latest release of Percona Toolkit. Or, get the latest release from the command line: .PP .Vb 1 \& wget percona.com/get/percona\-toolkit.tar.gz \& \& wget percona.com/get/percona\-toolkit.rpm \& \& wget percona.com/get/percona\-toolkit.deb .Ve .PP You can also get individual tools from the latest release: .PP .Vb 1 \& wget percona.com/get/TOOL .Ve .PP Replace \f(CW\*(C`TOOL\*(C'\fR with the name of any tool. .SH "AUTHORS" .IX Header "AUTHORS" Baron Schwartz .SH "ABOUT PERCONA TOOLKIT" .IX Header "ABOUT PERCONA TOOLKIT" This tool is part of Percona Toolkit, a collection of advanced command-line tools for MySQL developed by Percona. Percona Toolkit was forked from two projects in June, 2011: Maatkit and Aspersa. Those projects were created by Baron Schwartz and primarily developed by him and Daniel Nichter. Visit to learn about other free, open-source software from Percona. .SH "COPYRIGHT, LICENSE, AND WARRANTY" .IX Header "COPYRIGHT, LICENSE, AND WARRANTY" This program is copyright 2011\-2018 Percona \s-1LLC\s0 and/or its affiliates, 2010\-2011 Baron Schwartz. .PP \&\s-1THIS PROGRAM IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0 .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation, version 2; \s-1OR\s0 the Perl Artistic License. On \s-1UNIX\s0 and similar systems, you can issue `man perlgpl' or `man perlartistic' to read these licenses. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, \s-1MA\s0 02111\-1307 \s-1USA.\s0 .SH "VERSION" .IX Header "VERSION" pt-ioprofile 3.2.1