Does anyone know whether there is a way to speed up writing to a shared folder on the host system.
The host is running Ubuntu 10.10 and the guest is CentOS 5.5 and I have noticed a considerable decrease in speed when writing to the shared folder.
[vincent@dev8 ~]$ bonnie -s 2000
Bonnie 1.4: File './Bonnie.16947', size: 2097152000, volumes: 1
Writing with putc()... done: 51196 kB/s 70.8 %CPU
Rewriting... done: 101780 kB/s 11.1 %CPU
Writing intelligently... done: 46673 kB/s 6.9 %CPU
Reading with getc()... done: 41970 kB/s 57.1 %CPU
Reading intelligently... done: 108134 kB/s 12.3 %CPU
Seeker 1...Seeker 2...Seeker 3...start 'em...done...done...done...
---Sequential Output (nosync)--- ---Sequential Input-- --Rnd Seek-
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --04k (03)-
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU
dev8.b 1*2000 51196 70.8 46673 6.9 101780 11.1 41970 57.1108134 12.3 362.8 3.9
[vincent@dev8 sharedfolder]$ bonnie -s 2000
Bonnie 1.4: File './Bonnie.16933', size: 2097152000, volumes: 1
Writing with putc()... done: 30547 kB/s 66.6 %CPU
Rewriting... done: 32763 kB/s 12.0 %CPU
Writing intelligently... done: 111468 kB/s 20.6 %CPU
Reading with getc()... done: 36909 kB/s 71.4 %CPU
Reading intelligently... done: 299752 kB/s 39.0 %CPU
Seeker 1...Seeker 2...Seeker 3...start 'em...done...done...done...
---Sequential Output (nosync)--- ---Sequential Input-- --Rnd Seek-
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --04k (03)-
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU
dev8.b 1*2000 30547 66.6111468 20.6 32763 12.0 36909 71.4299752 39.0 16816.8 140
As you can see the writing and reading to the shared folder is a lot heavier on the resources.
At first I though it might be to do with the fact that Ubuntu was using ext4 and CentOS ext3 however even when I used a ext3 partition for the shared folder on the host system it did not improve.
Has anyone seen this problem before?Is it normal? Can it be improved?
Thanks for all your help.
EDIT
Its a virtualbox shared folder, which means that the fs is vboxsf. Its mounted through fstab:
sf_label /mount/dir vboxsf rw,uid=48,gid=48,dmode=774,fmode=774 0 0
hmm, non-shared (=virtual disk inside a file) is slower than shared (=directory on real fs, accessed thru vboxsf) : Writing intelligently... done: 46673 kB/s 6.9 %CPU vs Writing intelligently... done: 111468 kB/s 20.6 %CPU
It seems emulating a disk within a file slows IO down (unsurprising), and sharing is faster. the price to pay is higher cpu usage (and defeated isolation from host OS).
Anyway, thanks for those measures, I was wondering whether using shared folders would give better IO speed than virtual disk, and it definitely does.