Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 May 2011 07:09:56 -0500
From:      Adam Vande More <amvandemore@gmail.com>
To:        John <aqqa11@earthlink.net>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: virtualbox I/O 3 times slower than KVM?
Message-ID:  <BANLkTikyzGZt6YUWVc3KiYt_Of0gEBUp%2Bg@mail.gmail.com>
In-Reply-To: <10651953.1304315663013.JavaMail.root@mswamui-blood.atl.sa.earthlink.net>
References:  <10651953.1304315663013.JavaMail.root@mswamui-blood.atl.sa.earthlink.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 2, 2011 at 12:54 AM, John <aqqa11@earthlink.net> wrote:

> On both the FreeBSD host and the CentOS host, the copying only takes 1
> second, as tested before.  Actually, the classic "dd" test is slightly
> faster on the FreeBSD host than on the CentOS host.
>
> The storage I chose for the virtualbox guest is a SAS controller.  I found
> by default it did not enable "Use Host I/O Cache".  I just enabled that and
> rebooted the guest.  Now the copying on the guest takes 3 seconds.  Still,
> that's clearly slower than 1 second.
>
> Any other things I can try?  I love FreeBSD and hope we can sort this out.
>

Your FreeBSD Host/guest results seem relatively consistent with what I would
expect since VM block io isn't really that great yet, however the results in
your Linux VM seems too good to be true.  Have you tried powering off the
Linux VM immediately after the cp exits and md5'ing the two files?  This
will insure your writes are completing successfully.

Also, it may be this type of operation really is faster on your Linux setup,
but is it representative of the primary workload?  If not, you'll probably
want to arrange some type of benchmark that mimics real world IO flows as
hypervisor IO performance varies across workloads(example: it used to be
true KVM wasn't very good at concurrent IO, not sure if it's better now).
You should also ensure caches are not effecting the outcome of consecutive
benchmarks runs.  umounting and remounting the file system on your SAS
controller is the quickest way to do this, but depending on your setup you
may need to reboot.  If you do want to test with caching involved, you
should discard the initial run from your results.  Use something like
/usr/bin/time to get consistent results of how long operations took.  Ensure
each setup is running in a minimal configuration so there is less resource
contention.

Also single runs are a terrible way benchmark things.  You *need* multiple
runs to ensure accuracy.  ministat(1) is a tool in base to help with this.
Here is more detail:

http://ivoras.sharanet.org/blog/tree/2009-12-02.using-ministat.html
http://lists.freebsd.org/pipermail/freebsd-current/2011-March/023435.html

-- 
Adam Vande More



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTikyzGZt6YUWVc3KiYt_Of0gEBUp%2Bg>