Reputation: 935
dstat provides --top-latency and --top-latency-avg plugins in order to show processes with highest latencies (in ms).
How does it work this? I run a simple dd, which output it's latency, run dstat with these plugins, I sum the latencies for this process and the result wasn't the same.
Actually, it was higher! dd displayed 13s and dstat 21s, after summing the milliseconds.
Do I have understand it correctly? Is there any other tool which measure the latency per process?
Upvotes: 1
Views: 787
Reputation: 2404
The dstat command is using information from /proc/<PID>/schedstat
. the format of this file is documented at https://www.kernel.org/doc/Documentation/scheduler/sched-stats.txt
You can see how it is used in the dstat's source code: https://github.com/dagwieers/dstat/blob/master/plugins/dstat_top_latency.py#L42
Upvotes: 1
Reputation: 41
Consider using the latencytop tool
Synopsis latencytop [--unknown] [processes...]
Description (from the manual):
"Latencytop is a Linux* tool for software developers (both kernel and userspace), aimed at identifying where in the system latency is happening, and what kind of operation/action is causing the latency to happen so that the code can be changed to avoid the worst latency hiccups."
Upvotes: 1