0

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 ?

ntcong
  • 101
  • 3

2 Answers2

0

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.

Sirch
  • 5,785
  • 4
  • 20
  • 36
  • 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 – ntcong Jun 25 '13 at 08: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 08: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 – ntcong Jun 25 '13 at 08:39
  • If you are really interested, you can `apt-get source coreutils` and look at the source code. – Sirch Jun 25 '13 at 08:56
0

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.

ntcong
  • 101
  • 3