67

My disk often is utilized, but top (and htop, a custom replacement) show nothing suspicious.

Is there a way to sort processes by I/O (more specific: disk) utilization?

EDIT
Found out using iotop that those strange processes are flush-8:16 and jbd2/sdb3-7. Seems to have to do with usual filesystem operations.

3
  • 1
    If I'm correct flush and jbd concerns the sync of the journal (FS metadata) to the disk. Which means you must have some processes either writing to the disk or reading a lot of data and you have the atime option on your mount. I don't recommend this because some software relies on it (mutt and I have heard one backup tool) but you can set your mount to relatime or even "better" noatime. The latter will completely stop updating the access time (which incures a disk write) each time a file is read.
    – Huygens
    Jul 27, 2012 at 21:48
  • serverfault.com/questions/25032/…
    – qwr
    Jul 5, 2019 at 21:44

3 Answers 3

67

Have you tried iotop ?

You may need to install it before. Also, it depends on a kernel feature that may or may not enabled in your specific distribution.

3
  • 1
    Works on Mac OS X, too. Not sure that it is going to help with the problem at hand, though. Mar 2, 2010 at 16:27
  • 4
    wow. That's fantastic. 15+ years of admin work and I've never run into that. Thanks!
    – skarface
    Mar 2, 2010 at 17:06
  • 3
    Root access needed, FYI. Jan 24, 2015 at 17:27
27

You might want to give atop a try. It seems to do a good job of letting you know what is going on.

2
  • 2
    Seems to be better than iotop because it also shows IO busy percent.
    – sorin
    Mar 18, 2014 at 13:36
  • 2
    Also no root or suid needed.
    – Rolf
    Feb 25, 2018 at 21:08
5

iostat is still the king of detailed I/O information, the kind of info that can confirm if your SSD is living up to expectations, for example.

$ iostat -xht 5 nvme0n1
Linux 4.15.0-43-generic (myhost)    06/02/2021  _x86_64_    (8 CPU)

06/02/2021 08:59:20 AM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.6%    0.1%    0.8%    0.1%    0.0%   96.4%

Device            r/s     w/s     rkB/s     wkB/s   rrqm/s   wrqm/s  %rrqm  %wrqm r_await w_await aqu-sz rareq-sz wareq-sz  svctm  %util
nvme0n1
                95.03   20.80      1.8M    300.1k     0.00    13.15   0.0%  38.7%    0.24    0.57   0.03    19.2k    14.4k   0.02   0.3%

Every five seconds, this will print detailed IO stats for the NVMe drive. The most important ones are usually not actually read/write bandwidth -- rKB/s and wKB/s -- but rather the reads and writes per second (r/s and w/s, aka IOPS) and, perhaps most important, the average time a process waited for each read and write -- r_await and w_await (in milliseconds).

All of these values feed into each other using the surprisingly useful Little's law formula, translated a bit to latency = queue_size / IOPS, or await = aqu_sz / (r/s + w/s).

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.