Subject: Re: Bad performance of virtual disk driver
To: Matthias Scheler <tron@zhadum.de>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: port-xen
Date: 05/03/2005 21:55:44
On Tue, May 03, 2005 at 03:26:42PM +0100, Matthias Scheler wrote:
> On Tue, May 03, 2005 at 02:34:56PM +0100, Matthias Scheler wrote:
> > I've using the following setup:
> > 
> > Hypervisor:	Xen 2.0.5
> > dom0:		Linux 2.6.10
> > domU:		NetBSD 3.0_BETA (sources from 2005-04-28)
> > 
> > The performace of the virtual disks is very bad ...
> > 
> > 	# dd if=/dev/xbd1b of=/dev/null bs=1024k
> > 	512+0 records in
> > 	512+0 records out
> > 	536870912 bytes transferred in 331.800 secs (1618055 bytes/sec)
> > 
> > ... compared to the performance in the Linux dom0:
> > 
> > 	# dd if=/dev/vg/matthias-1swap of=/dev/null bs=1024k
> > 	512+0 records in
> > 	512+0 records out
> > 	536870912 bytes transferred in 15.469114 seconds (34705990 bytes/sec)
> 
> Performance in an unpriviliged Linux domain on the same machine ...
> 
> 	# dd if=/dev/sda2 of=/dev/null bs=1024k
> 	200+0 records in
> 	200+0 records out
> 	209715200 bytes transferred in 20.675648 seconds (10143102 bytes/sec)
> 
> ... is also slower than in the Linux dom0:
> 
> 	# dd if=/dev/vg/jds3swap of=/dev/null bs=1024k
> 	200+0 records in
> 	200+0 records out
> 	209715200 bytes transferred in 5.931684 seconds (35355086 bytes/sec)
> 
> But here it is only by a factor of 3 and not 20.

Martti's benchmarks showed that a NetBSD domain0 was a better xbd provider
than linux. I've seen that linux/xen has some code to limit the I/O rate
of guest OSes, maybe this is what causes the bad performances here ?
The difference between NetBSD and linux DomU could be related to
MAXPHYS. I don't know how big disk requests can be in linux, but it could be
as large as 1MB.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--