0

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.

Ahmed A
  • 3,362
  • 7
  • 39
  • 57
  • 1
    [so] is for programming questions, not questions about using or configuring Linux and its applications. [su] or [unix.se] would be better places for questions like this. – Barmar Aug 20 '18 at 19:37
  • I'm pretty sure each report is the average since the previous report, not instantaneous. – Barmar Aug 20 '18 at 19:40
  • This might be an overkill, but sar collects a lot of performance data. https://linux.die.net/man/1/sar – UncleCarl Aug 20 '18 at 22:32
  • @UncleCarl sar has the same options (interval and count) as iostat. Same question applies to sar as well, when displaying perf stat every n seconds, is the number the average over the past n seconds or snapshot (value read from proc fs entry).? – Ahmed A Aug 20 '18 at 22:46

0 Answers0