Tomas-M / iotop

A top utility for IO
Other
376 stars 50 forks source link

Processes sometimes don't show up? #50

Closed Atemu closed 11 months ago

Atemu commented 1 year ago

Sometimes when I start iotop-c -o when a process is already running, that process will not be shown. It does show a Total DISK WRITE including that process' IO and a few btrfs threads but their small IO doesn't add up to the total.

This does not happen with the python iotop.

The issue is very spurious and hard to reproduce.

bbonev commented 1 year ago

In curses mode, -o depends on several things:

There is a 'feature' with newer kernels - changing kernel.task_delayacct will not affect already running processes.

And there is one more moving part - it is possible for a process to have R/W with IO being zero (or more precisely said, rounded off to zero).

One way to see if that is the case is to change the graph type to R+W when this happens.

Atemu commented 1 year ago

kernel.task_delayacct was enabled in my case and the exact command was sudo iotop-c --hide-prio --hide-graph -o -e.

bbonev commented 1 year ago

With the combination of --hide-graph and kernel.task_delayacct=1, -o to will only show processes with non-zero IO wait. Unless kernel.task_delayacct is activated as kernel boot parameter, there may be processes that will perform IO and have IO wait with zero value - current kernels do not start tracking that for existing processes after activating task_delayacct.

I understand and agree that this is confusing, but I see no possible fix for it. If I am missing some way to improve this, please share it.

Atemu commented 1 year ago

With the combination of --hide-graph and kernel.task_delayacct=1, -o to will only show processes with non-zero IO wait.

Is it not possible to filter using another metric?
Or make --hide-graph keep the same behaviour as with the graph for filtering purposes but simply don't draw it?

Python iotop -o has been showing all processes just fine for me without delayacct (just with a broken swapin column which I don't care about).

bbonev commented 1 year ago

Maybe it will be saner to change the -o logic to do an OR between IO, R and W. What do you think?

Atemu commented 1 year ago

That sounds sane to me; any process that causes any sort of disk IO should show up in -o.

Is the IO metric only for disk IO or also IO to tmpfs and the like?

bbonev commented 1 year ago

@pabs3 I'd appreciate your thoughts on this. IMO, it is better to make it more user friendly and closer to the user's expectations than to blindly stick to exactly what iotop-py is doing

pabs3 commented 1 year ago

Yes, definitely better to be user friendly than copying iotop-py.

-- bye, pabs

https://bonedaddy.net/pabs3/

bbonev commented 11 months ago

I believe that this got fixed in b787f78c578563f3c2ca158e02619695167f2b03