Page 1 of 1

VirtualBox 5.1 - Virtual Disk behaves like it is cached, even though it is not

Posted: 22. Jul 2016, 16:14
by tryfonaration
Hello,
I wonder if anyone is facing the same issue I do on the VirtualBox 5.1 on linux host.
I have a centos 7.0 VM on a Ubuntu 16.04 LTS host, running VirtualBox 5.1.2r108956 I setup a new 2GB vdi virtualdisk, write-through, fixed-size, with the vdi file sitting in a folder on my host's hard disk and attach it on the vm with the sata controller set not to use host i/o cache. I then start the vm, login in the vm and run fio on the entire 2GB disk, 1 thread, iodepth 1, 4K block size. The results I get from fio are the following:

Code: Select all

./fio-generator.sh /dev/sdf 1 1 4k 10 randread 8000 0 1
offset=0m
filesize=8000m
thread: (g=0): rw=randread, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=1
fio-2.2.8
Starting 1 process
Jobs: 1 (f=1): [r(1)] [100.0% done] [57924KB/0KB/0KB /s] [14.5K/0/0 iops] [eta 00m:00s]
thread: (groupid=0, jobs=1): err= 0: pid=3919: Fri Jul 22 13:49:05 2016
  read : io=587456KB, bw=58740KB/s, iops=14684, runt= 10001msec
    slat (usec): min=9, max=701, avg=11.64, stdev= 3.32
    clat (usec): min=15, max=4378, avg=55.13, stdev=25.83
     lat (usec): min=50, max=4389, avg=66.91, stdev=26.73
    clat percentiles (usec):
     |  1.00th=[   43],  5.00th=[   45], 10.00th=[   45], 20.00th=[   47],
     | 30.00th=[   48], 40.00th=[   50], 50.00th=[   53], 60.00th=[   55],
     | 70.00th=[   56], 80.00th=[   59], 90.00th=[   65], 95.00th=[   73],
     | 99.00th=[   97], 99.50th=[  113], 99.90th=[  306], 99.95th=[  422],
     | 99.99th=[ 1080]
    bw (KB  /s): min=56672, max=60192, per=99.95%, avg=58707.37, stdev=945.36
    lat (usec) : 20=0.01%, 50=35.78%, 100=63.34%, 250=0.75%, 500=0.09%
    lat (usec) : 750=0.01%, 1000=0.01%
    lat (msec) : 2=0.01%, 4=0.01%, 10=0.01%
  cpu          : usr=0.00%, sys=21.54%, ctx=146864, majf=0, minf=32
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued    : total=r=146864/w=0/d=0, short=r=0/w=0/d=0, drop=r=0/w=0/d=0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: io=587456KB, aggrb=58739KB/s, minb=58739KB/s, maxb=58739KB/s, mint=10001msec, maxt=10001msec

Disk stats (read/write):
  sdf: ios=145391/0, merge=0/0, ticks=9188/0, in_queue=9187, util=91.90%
fio-generator.sh is a script I have authored that makes fio usage simpler. The parameters given are visible in fio's output. This latency and IOPS are not representative of an HD rotational device. This was not the case in VirtualBox 5.0 I want to have devices in my VMs for developing purposes that exhibit rotational hard disks I/O characteristics, and it seems that now I cannot.

Re: VirtualBox 5.1 - Virtual Disk behaves like it is cached, even though it is not

Posted: 22. Jul 2016, 17:43
by socratis
  1. What on earth is a fio? Where can I buy one?
    If a term is not widely used, it would be better if you gave a short definition or point to somewhere that the term is explained. I could start talking about thixotropic fluids and Bingham's pseudoplastics and it would be all Greek to you (actually I could be speaking in Greek if you wanted to ;) ).
  2. Where's the question in there? Did I miss something?

Re: VirtualBox 5.1 - Virtual Disk behaves like it is cached, even though it is not

Posted: 22. Jul 2016, 18:06
by mpack
tryfonaration wrote:This latency and IOPS are not representative of an HD rotational device.
I'm not aware of any VirtualBox documentation which claims that hard drives will exhibit performance characteristics of a rotational device. A VDI is a host file. It will exhibit whatever performance the host drive gives it.

Re: VirtualBox 5.1 - Virtual Disk behaves like it is cached, even though it is not

Posted: 22. Jul 2016, 23:04
by tryfonaration
@socratis: fio is an opensource program, distributed as a package together with all mainstream linux distributions, for testing I/O characteristics of storage devices, developed by Intel mainly I think (check the man page)
@mpack: As I explained in my first post the vdi files are placed on my host's hard disk. When I run random read fio on them from my host they exhibit the expected performance of a rotational device. When I do what I explained in my first post from within the guest VM they perform out of the charts, something that was not happening with VirtualBox 5.0 I edited my initial post to make the question clear.

Re: VirtualBox 5.1 - Virtual Disk behaves like it is cached, even though it is not

Posted: 22. Jul 2016, 23:23
by socratis
Got it. Thank you tryfonaration.

Re: VirtualBox 5.1 - Virtual Disk behaves like it is cached, even though it is not

Posted: 26. Jul 2016, 11:51
by tryfonaration
Bump!