about the "disk queue" between netxms and "iostat"

Started by x199x, March 23, 2012, 04:00:42 AM

Previous topic - Next topic

x199x

Hi:
I used the netxms1.1.6, Linux
I found the System.IO.DiskQueue to get the disk queue value in netxms is far different from that I get with "iostat" tool. (Event the netxms flush the value in one minutes and iostat flush the value in one second)
So I saw the source code in netxms and iostat. Both of then get the value through the /proc/diskstats. they get the value is such like that:

   8    0 sda 34567 17159 1358372 355080 20268 49302 556588 1263830 1 150950 1622600
                                                                                                  |                |
                                                                                              netxms          iostate

but the netxms get the 11th value ( it is 1 ) while the iostate get the last one (it is 1622600) to do the calculation.

I want to know,if the concept of "disk queue"  in netxms is different from that in "iostat"?    or what's the  definition of "disk queue" in netxms.

Thanks!

Victor Kirhenshtein

Hi!

/proc/diskstats has the following fields (numbering started after device name):

Field 1 — # of reads issued
Field 2 — # of reads merged
Field 3 — # of sectors read
Field 4 — # of milliseconds spent reading
Field 5 — # of writes completed
Field 6 — # of writes merged
Field 7 — # of sectors written
Field 8 — # of milliseconds spent writing
Field 9 — # of I/Os currently in progress
Field 10 — # of milliseconds spent doing I/Os
Field 11 — weighted # of milliseconds spent doing I/Os

NetXMS agent gets field #9 (# of I/Os currently in progress) to calculate average disk queue size. And "disk queue" means "number of disk I/O requests that are either in service or waiting for service". In iostat, it's a parameter called avgqu-sz (shown if running with -x command line option). On my NetXMS server it looks like this:


root@netxms:~# iostat -x 1
Linux 2.6.32-5-686 (netxms)     03/24/2012      _i686_  (2 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           8.26    0.00    2.39    3.24    0.00   86.11

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
cciss/c0d0        0.02    39.01    3.07   26.43   265.29   523.52    26.74     0.17    5.64   3.27   9.66

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.50    0.00    1.50    2.00    0.00   96.00

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
cciss/c0d0        0.00    13.00    0.00   13.00     0.00   208.00    16.00     0.05    4.00   4.00   5.20

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           3.45    0.00    1.48    0.49    0.00   94.58

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
cciss/c0d0        0.00     8.00    0.00    3.00     0.00    88.00    29.33     0.02    6.67   4.00   1.20

^C
root@netxms:~# nxget 127.0.0.1 "System.IO.DiskQueue(cciss/c0d0)"
0.033333
root@netxms:~#


Best regards,
Victor




x199x

Thanks for your answer.
But I saw the  iostat source code,and found that, the  iostat  get the disk queue with the  Field 11 — weighted # of milliseconds spent doing I/Os
while netxms with the Field 9 — # of I/Os currently in progress.

So I think, may be there is something wrong with the iostat to get the disk queue value.

Victor Kirhenshtein

That's very interesting, because at least on my system iostat's result are consistent with value given by NetXMS agent. Can you point me to exact place in iostat source code?

Best regards,
Victor