Open emandret opened 2 weeks ago
Weirdly, it seems that just renaming two variables in the --top-io
plugin file solves the issue. I have no idea, but this does work on my machine:
sudo cp /usr/share/dool/dool_top_io.py /usr/share/dool/dool_top_io.py.orig
sudo sed -i -e 's/read_bytes/rchar/g' -e 's/write_bytes/wchar/g' /usr/share/dool/dool_top_io.py
dool --top-io
It seems like this is related to the values defined in /proc/*/io
as follows:
cat /proc/$(pgrep python3)/io
Which on my machine, returns,
rchar: 60131822108
wchar: 22285226750
syscr: 74499098
syscw: 21285429
read_bytes: 0
write_bytes: 0
cancelled_write_bytes: 0
Good research! Looks like that change landed in 64c2cc4d589de156e6a4318ee6836348740d58c9
The documentation on that file in proc is here. Honestly, after reading that I'm not sure which field we should be using.
There are four plugins that all seem to access read_bytes
:
plugins/dool_top_io.py plugins/dool_top_bio.py plugins/dool__pid_detail.py plugins/dool_top_bio_adv.py
Whatever we decide, we should make sure all the plugins are set the same.
SUMMARY
The
--top-io
flag should report the process causing the largest number of IO operations, but it seems like this does not work if the process is spawning child processes which are causing the IO operations.However,
dstat --top-io
correctly reports the parent process. I looked at the code for the--top-io
plugin and the code is similar, so I wonder what could be causing such a difference.ISSUE TYPE
DOOL VERSION
Dool 1.3.2
OS / ENVIRONMENT
Platform posix/linux Kernel 5.15.0-119-generic Python 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0]
STEPS TO REPRODUCE
Save this python snippet at
/tmp/high_tps.py
,And run,
EXPECTED RESULTS
The output of both
dstat --top-io
anddool --top-io
should match.ACTUAL RESULTS
See screenshot in the comments.