Page 1 of 1

vdi on tmpfs and/or raw access: where's the performance?

Posted: 10. Jan 2008, 22:23
by Elle Stone
On this thread:

http://forums.virtualbox.org/viewtopic. ... ight=tmpfs

kilou and Technologov talk about using tmpfs as a place to put a windows swap file. Their goal is allow windows guest on linux host to either dynamically allocate ram to guest or to give the guest more than 2gb of ram. I have a slightly different goal. I'd like to give photoshop in my w2k VM on linux host a scratch disk that resides in my "extra" ram and or linux swap space (three 3gb swap partitions, one each on 3 sata drives, same priority so essentially "raided").

The photoshop "scratch disk" holds a kind of "dedicated swap" for photoshop exclusive use - photoshop doesn't use windows swap. But anyone needing to do repeated read and write to a large file (prior to saving a permanent copy elsewhere) would find a small disk entirely held in ram very useful.

I created a tmpfs and mounted it using the following command:

sudo mount -t tmpfs -o size=3G,nr_inodes=64 tmpfs /media/mytmp

From within the linux host I copied files disk to mytmp, mytmp to mytmp, mytmp to disk, all goes pretty rapidly.

I went to the Virtual Disk Manager and created a 2.51gb vdi on /media/mytmp, and attached it to my w2k vm, opened the vm, opened "computer management", formatted the new disk, went to the dos command line and copied some files over.

I didn't do actual timing, but seriously, copying half-gig files, I couldn't see a significant difference in time copying a file from one drive to another, whether virtual drive to tmpfs virtual drive, or virtual drive (vdi) to raw access drive (vmd) or tmpfs virtual drive to tmpfs virtual drive. Anyway I tried, the copy process is significantly slower than doing the same kind of transfers from within the linux host.

Perhaps I am not creating the "tmpfs" vdi correctly?

In this post,
http://forums.virtualbox.org/viewtopic. ... ht=ramdisk
Technologov suggests using a ramdisk. Guess I'll try that next.

Has anyone successfully used a tmpfs or a ramfs as a place to hold a vdi disk and thereby improved read/write on large files from within a windows guest on linux host? Any other suggestions on how to speed up read/write of large files?

Elle

Re: vdi on tmpfs and/or raw access: where's the performance?

Posted: 15. Jan 2008, 12:39
by Ingo
I guess the bottleneck isn't the access to the hard disk but the management of two file systems.
User Manual chapter 9.9 wrote:With VirtualBox, this type of access is called “raw hard disk access”; it allows a guest operating system to access its virtual hard disk much more quickly than with disk images, since data does not have to pass through two file systems (the one in the guest and the one on the host).
I suggest to try using a raw host hard disk from a guest instead of a ram disk for the VDI file.

Posted: 15. Jan 2008, 14:35
by Elle Stone
Ingo, thanks. I've already tried the raw access and truthfully it didn't make much difference. I'll probably try again, though.

Elle