Clock Blog

VirtualBox 4.0 Shared Folders Still Slow

Posted on Friday, 7 January 2011 @ 14:41 GMT in tech-blogs by Paul Serby

I've recently installed the newest version of VirtualBox. I had every finger and toe crossed in the hope that my long standing bug with Shared Folders would be fixed.

We run an Ubuntu 10.04.1 VM and use a Apache/PHP stack and serve up sites using files from a folder on the host environment. This method works very well for us, but does mean that a folder on the host system has to somehow be mounted on the guest Linux system. The way the VM software allow this is via a Shared Folder mechanism. You configure a host folder with a identifier and then this is available to mount within the guest system.

Unfortunately Shared Folders on VirtualBox have always preformed badly with our setup and the VirtualBox 4.o release does nothing to improve that:

Using Apache Bench (ab) I get the following results using Shared Folder:

$ ab -c 10 -n 500 http://localhost/resource/image/sprite.png
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests

Server Software:        Apache/2.2.14
Server Hostname:        localhost
Server Port:            80

Document Path:          /resource/image/sprite.png
Document Length:        22581 bytes

Concurrency Level:      10
Time taken for tests:   2.753 seconds
Complete requests:      500
Failed requests:        0
Write errors:           0
Total transferred:      11474000 bytes
HTML transferred:       11290500 bytes
Requests per second:    181.63 [#/sec] (mean)
Time per request:       55.058 [ms] (mean)
Time per request:       5.506 [ms] (mean, across all concurrent requests)
Transfer rate:          4070.29 [Kbytes/sec] received

Connection Times (ms)
 min  mean[+/-sd] median   max
Connect:        0    0   0.6      0       5
Processing:    31   55  14.7     50     118
Waiting:       31   54  14.7     50     118
Total:         31   55  14.9     50     120

Percentage of the requests served within a certain time (ms)
 50%     50
 66%     55
 75%     61
 80%     65
 90%     75
 95%     88
 98%    100
 99%    110
 100%    120 (longest request)
If you unmount the Shared Folder then mount the folder over samba you get the following:
ab -c 10 -n 500 http://localhost/resource/image/sprite.png
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking
localhost
(be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests

Finished 500 requests
Server Software:        Apache/2.2.14

Server Hostname:        localhost
Server Port:            80
Document Path:          /resource/image/sprite.png
Document Length:        22581 bytes
Concurrency Level:      10

Time taken for tests:   1.184 seconds
Complete requests:      500
Failed requests:        0
Write errors:           0
Total transferred:      11473517 bytes
HTML transferred:       11290500 bytes
Requests per second:    422.31 [#/sec] (mean)
Time per request:       23.679 [ms] (mean)
Time per request:       2.368 [ms] (mean, across all concurrent requests)
Transfer rate:          9463.72 [Kbytes/sec] received

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:        0    0   0.3      0       3
Processing:     9   23  19.6     16     121
Waiting:        9   23  19.3     16     121
Total:          9   23  19.6     16     121
Percentage of the requests served within a certain time (ms)

50%     16
66%     20
75%     26
80%     28
90%     39
95%     72
98%    111
99%    115
100%    121 (longest request)

As you can see you get 422 requests per second over Samba and on 181 when using Shared Folders. I repeated the test on Windows hosts and got similar results.

On VMWare Fusion and the shared folders performed really well.

So it looks like for now we will have to stick to using the samba shares.

blog comments powered by Disqus