Linux – iotop does not show writes

iolinuxsystem-monitoring

What could be writing on the disk that iotop does not show?

# iotop -a
Total DISK READ: 8.19 M/s | Total ****DISK WRITE: 3.34 M/s****
  TID  PRIO  USER     DISK READ DISK WRITE>  SWAPIN      IO    COMMAND
  428 be/4 root          0.00 B     84.00 K  0.00 %  0.02 % [kjournald]
 2600 be/3 root          0.00 B      8.00 K  0.00 %  0.01 % auditd -s disable
 2582 be/4 root          0.00 B      4.00 K  0.00 %  0.00 % syslog-ng

(iotop is NOT run using -o)

How do you interpret this?

# iostat
Linux 3.0.51-0.7.9-default (x)   03/10/13        _x86_64_

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
       1.08    0.00    1.33    5.27    0.00   92.32

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda               5.10       173.02        14.35  824994560   68417967
sdb              79.08      1028.23      1018.19 4902923384 4855045168
sr0               0.00         0.00         0.00        988          0
dm-0            175.34      1028.23      1018.19 4902916232 4855045168

Best Answer

I was wondering about the difference between the 'Total DISK WRITE' and the 'Actual DISK WRITE'. Running iotop -a shows the actual disc write. If you write sth. to the disc the kernel can cache these writes for you (I think that was what vonbrand meant). You can check if there are some dirty pages that need to be written to the disc using: cat /proc/vmstat | egrep "dirty|writeback" [0]. If nr_dirty > 0, then there are some pages that need to be written to the disc.

In your case only the actual read/write speeds are shown. And the processes had already finished the writing, but the changes have not been written to the disc, yet. The kernel was currently doing this, when you had the look at iotop. You do not see a process writing, but you see that there is data been written to the disc.

That's also the reason why sometimes the two values (total read/write and actual read/write) at the top of iotop are not equal.

[0] https://lonesysadmin.net/2013/12/22/better-linux-disk-caching-performance-vm-dirty_ratio/

Related Topic