LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Monitoring disk activity with vmstat gives strange values. Why? (https://www.linuxquestions.org/questions/linux-software-2/monitoring-disk-activity-with-vmstat-gives-strange-values-why-390050/)

tobikars 12-07-2005 12:07 AM

Monitoring disk activity with vmstat gives strange values. Why?
 
Hi All,

Does anybody have experience monitoring disk-activity under Linux?

I have been trying to monitor the hard-disk activity on one of our servers, I am using Centos 4.2 with vmstat from procps version 3.2.2

When I use vmstat -d to get the the data, it returns data for the "milliseconds read":


disk- ------------reads------------ ------------writes----------- -----IO------
total merged sectors ms total merged sectors ms cur sec
hda 11851138 93245 438284844 173684652 6626679 12498683 153004821 268565968 0 23250

Using this data, I run a script with Cron that gets the vmstat-output every 5 minutes in the below format:
(format: Date, Timstamp(seconds), ms_read)

Tue Dec 6 17:35:01 CST 2005 1133861701 173695461
Tue Dec 6 17:40:01 CST 2005 1133862001 173695497
Tue Dec 6 17:45:01 CST 2005 1133862301 173695848
Tue Dec 6 17:50:04 CST 2005 1133862604 174056507
Tue Dec 6 17:55:02 CST 2005 1133862902 175167830
Tue Dec 6 18:00:02 CST 2005 1133863202 175894743
Tue Dec 6 18:05:01 CST 2005 1133863501 175896606
Tue Dec 6 18:10:02 CST 2005 1133863802 177400989 *
Tue Dec 6 18:15:05 CST 2005 1133864105 178477129 *
Tue Dec 6 18:20:48 CST 2005 1133864448 179404649
Tue Dec 6 18:25:03 CST 2005 1133864703 179537470
Tue Dec 6 18:30:03 CST 2005 1133865003 180542458

I loaded up the disk with a few cp-commands (during the * marked period).

In this 5 minute-period, vmstat is trying to tell me that it spent 178477129-177400989 = 1,504,383 milliseconds reading, while the timestamp shows around 300 seconds (=300,000 milliseconds).

How is this possible? Is there a bug in vmstat? Am I not reading the right parameter from the vmstat output?


All times are GMT -5. The time now is 01:44 AM.