pt-stalk top CPU usage is useless
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Committed
|
Medium
|
Carlos Salguero |
Bug Description
pt-stalk runs "top -bn1" which means that a single iteration of top is ran. The result is that top can't calculate a useful CPU usage because it needs a basis of comparison. From https:/
The top command calculates %CPU by looking at the change in CPU time values between samples. When you first run it, it has no previous sample to compare to, so these initial values are the percentages since boot. It means you need at least two loops.
Michael discovered this because he specifically wanted historical CPU usage, knowing that it was running high, but the collected top output from pt-stalk was only showing 6% CPU usage--way below reality.
Perhaps we need to run "top -bn$OPT_RUN_TIME".
description: | updated |
Changed in percona-toolkit: | |
status: | Confirmed → Triaged |
assignee: | nobody → Carlos Salguero (carlos-salguero) |
importance: | Undecided → Medium |
milestone: | none → 2.2.21 |
tags: | added: pt89 |
Changed in percona-toolkit: | |
status: | Triaged → Fix Committed |
top -bn$OPT_RUN_TIME worked like a charm to me, could we get that change in a future release?