June 24, 2003

Disk wait monitoring in Linux?

Any Linux sysadmins reading this?

In FreeBSD, I can use systat to find out how busy a given disk is. It looks like this:

Disks   da0   da1 pass0 pass1   md0
KB/t  26.67 22.10  0.00  0.00  0.00
tps       1     8     0     0     0
MB/s   0.02  0.18  0.00  0.00  0.00
% busy    0     4     0     0     0
queue     0     0     0     0     0

See, disk da1 was 4% busy during that 5 second snapshot. (I ran systat -v 5).

That's very useful when diagnosing a disk-bound MySQL server that's not doing lots of I/O but ends up waiting for lots of disk seeks on a slow RPM drive.

How do I do that in Linux?

I don't want to know how much I/O it's doing--that's easy... I want to know how often it's servicing an I/O request ('cause it may spend a lot of time seeking). I need to know how busy the disk is--even if it's not doing any I/O at the moment.

vmstat will give me I/O figures (read & write) but not % busy.

On Solaris, I'll use iostat to look at the average wait time for disk requests. It turns out that Linux can do the same thing. The await value tells you this.

However, I ran iostat -d -k -x 5 but got no data--just headers. It seems that -x only works in post 2.5 kernels. Damn.


My questions are two-fold:

  1. Can I get those stats for a 2.4.xx kernel? How?
  2. Can I get something like FreeBSD's systat % busy value in Linux? How?

Thanks to any pointers you might offer.

Update: Steve tried iostat -x on his RedHat 8 box and got meaningful output. Now I'm really puzzled.

Posted by jzawodn at 08:46 PM

Rude Blog Readers

No, I'm not talking about aggregators that suck down too much bandwidth. It seems that comments are being disabled in the Surfin' Safari blog.

I have decided to permanently disable comments in my Safari blog. Despite my repeated insistent attempts to explain that my blog is not a bug database, people still come here complaining about every random Web site that doesn't work. When I blog about a topic like "Standards Charts" instead of getting relevant feedback, I get more bug reports. In the real world this would be clearly impolite, somewhat akin to interrupting someone in the middle of a conversation in order to babble about a completely different subject, so what makes you think it's any less rude to do it in my blog comments?

Always refer to rule #1: People are stupid. (Even computer people. Especially some computer people.)

Posted by jzawodn at 08:31 PM