Baron Schwartz's Website
Archives Talks

Beware of Svctm in Linux’s Iostat

Published Sep 6, 2010 by Baron Schwartz in Databases, Operations at https://www.xaprb.com/blog/2010/09/06/beware-of-svctm-in-linuxs-iostat/

I’ve been studying the source of iostat again and trying to understand whether all of its calculations I explained here are valid and correct. Two of the columns did not seem consistent to me. The await and svctm columns are supposed to measure the average time from beginning to end of requests including device queueing, and actual time to service the request on the device, respectively. But there’s really no instrumentation to support that distinction. The device statistics you can get from the kernel do not provide timing information about device queueing, only a) begin-to-end timing of completed requests and b) the time accumulated by requests that haven’t yet completed. I concluded that the await is correct, but the svctm cannot be.

I just looked at the sysstat website, and it has been updated recently to warn about this, too:

svctm

The average service time (in milliseconds) for I/O requests that were issued to the device. Warning! Do not trust this field any more. This field will be removed in a future sysstat version.

Baron Schwartz

I’m the founder and CTO of VividCortex, author of several books, and creator of various open-source software. I write about topics such as technology, entrepreneurship, and fitness. More about me.

Story logo

© 2019 Baron Schwartz