Linux iostat "averaged" result over a period of time

454 Views Asked by At

I am using the iostat utility on my RedHat Linux server to monitor the performance of a disk. When I use "iostat -xd sdh 1", I get the perf result printed every one second. When I use "iostat -xd sdh 5", I get the perf result printed every five second. My feeling is the latter command is printing a snapshot of the perf every five second, rather than averaging over the past 5 seconds. Am I correct in my understanding?

If so, is there a way I can make iostat print the perf. number averaged over n seconds, or is there some other utility that will do that.

Currently, the perf number is fluctuating within a range, and I want to get a somewhat "stable" number. I am hoping that averaging over a period of time will give me such a number.

Thank you, Ahmed.

1

There are 1 best solutions below

0
mighq On

From man 1 iostat:

Each subsequent report covers the time since the previous report. Also, units in the column headers show that numbers usually are per-second rates.

Mind the -y option and the first output being statistics concerning the time since the system was booted if it is not passed.