Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I ran vmstat -D for 1s interval and take the different of milli reading/writing between two interval. Then I start copy a file to test.

bytes write per secs is 23.9M/s, and mili writing is 7244.

As vmstat documentation, mili writing is time spend writing in miliseconds, but why the disk spend 7.3s to write in just 1s ?

share|improve this question

2 Answers 2

Clearly a dodgy miscalculation, or you have multiple disks, or multiple files were written over that period, or cached. I would suggest not relying on this stat.

share|improve this answer
    
I have only one disk, and pretty sure it's only the file that was being written, even if there's another file, it's pretty small (just log or so) I also test by using psutil to run in Windows machine, and the same thing happens, around 10-15s in time spend writing in 1s interval –  Fu4ny Jun 25 '13 at 8:21
    
What distro are you using, are you just interested in a bug, or do you need to know how long a file takes to be written? –  Sirch Jun 25 '13 at 8:28
    
I'm using Ubuntu 13.04, also tested on Windows 8. The documentation in vmstat is very limited and I just want to know what those value means –  Fu4ny Jun 25 '13 at 8:39
    
If you are really interested, you can apt-get source coreutils and look at the source code. –  Sirch Jun 25 '13 at 8:56
up vote 0 down vote accepted

As stated on iostat documentation:

Field 4 -- # of milliseconds spent reading

  This is the total number of milliseconds spent by all reads (as
  measured from __make_request() to end_that_request_last()).

So this is the total number of ms by all reads, there's many read in one sec, that's why the total reading in ms is big

In my case:

"read_count": 340,
"read_delay": 1436,
"read_per_secs": "85.9M",

So in average each read requires 4ms to complete, which seems to be correct.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.