1

I noticed iotop is not showing me small disk writes. It completely omits them in its report.

To show you what I mean, here is a little bash script:

#!/bin/bash

sudo echo ''    # ask for the sudo rights before we go to background
sudo iotop -aktbo -qqq -d 5 | grep dd &
for num in {1..5}; do
    echo "Small write #$num"
    dd if=/dev/zero of=tmp.zeros.deleteme bs=65536 count=9 &>/dev/null
    sleep 1
done
echo "Big write #1"
dd if=/dev/zero of=tmp.zeros.deleteme bs=65536 count=9999 &>/dev/null
rm -f tmp.zeros.deleteme

I would expect sudo iotop -aktbo -qqq -d 5 | grep dd will show me both, the five small disk dumps in the loop, as well as the larger one with count=9999 towards the end.

However, it does't show the small five at all. Here is the output of above's script (I called it ddtest.sh) and some information on my system:

[confus@confusion:~] $ ./ddtest.sh 
[sudo] password for confus: 

Small write #1
Small write #2
Small write #3
Small write #4
Small write #5
Big write #1
15:03:20 17589 be/4 confus       28.00 K 210728.00 K  0.00 % 79.61 % dd if=/dev/zero of=tmp.zeros.deleteme bs=65536 count=9999
15:03:25 17589 be/4 confus       28.00 K 210728.00 K  0.00 % 39.75 % dd if=/dev/zero of=tmp.zeros.deleteme bs=65536 count=9999
[confus@confusion:~] $ uname -r
4.9.68-1-MANJARO
[confus@confusion:~] $ iotop --version
iotop 0.6

Why are the small writes (that take less than the sampling period of 5 seconds) not showing? How do I get them to show?

Also a thing to watch out for is that despite the --accumulated being set, iotop will restart the read/write counters when the file is closed and reopened by the same process.

2
  • Did you try performing the writes synchronously, i.e. conv=fsync oflag=sync? Dec 23 '17 at 14:15
  • Actually I did. Makes no difference. Also the main purpose is to pipe the output of iotop to a file for later analysis. I want all write operations captured in this file.
    – con-f-use
    Dec 23 '17 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.