pt-diskstats usage in non-interactive scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Triaged
|
Undecided
|
Unassigned |
Bug Description
I'm trying to run pt-diskstats as a collectd plugin because I like the information provided by this tool instead of iostat. The problem is when pt-diskstats is started up without being attached to the terminal, the parent (non data gathering) process uses %100 cpu. Strace output shows the following repeating very often.
select(8, [0], NULL, NULL, {1, 364751}) = 1 (in [0], left {1, 364744})
read(0, 0x133e400, 4096) = -1 EBADF (Bad file descriptor)
read(3, 0x1340860, 4096) = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0x1340860, 4096) = -1 EAGAIN (Resource temporarily unavailable)
select(8, [0], NULL, NULL, {1, 364372}) = 1 (in [0], left {1, 364365})
read(0, 0x133e400, 4096) = -1 EBADF (Bad file descriptor)
read(3, 0x1340860, 4096) = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0x1340860, 4096) = -1 EAGAIN (Resource temporarily unavailable)
Attached is a full strace output of the following command:
PTDEBUG=1 strace -ttt -s 1024 -o diskstats.strace -f nohup perl /usr/bin/
And a Devel::NYTProf html and original output of the following:
perl -d:NYTProf /usr/bin/
nohup perl -d:NYTProf /usr/bin/
My System:
[root@pt ~]# uname -a
Linux pt 2.6.32-
[root@pt ~]# cat /etc/redhat-release
CentOS release 6.2 (Final)
Replicated on Debian Squeeze
I know the intent of this script is to run in an interactive way however the data is too good not to trend in someway, which is done non-interactively.
Changed in percona-toolkit: | |
status: | New → Triaged |
You can run it as
perl /usr/bin/ pt-diskstats --iterations 2 < /dev/null (with nohup etc.)
as a workaround.
However, http:// sprunge. us/KNXc? pl can be added to pt-diskstats I guess, to prevent non-interactive use at all. (since the script is primarily interactive).