Skip to contentSkip to conversation

PHY vs. VD benchmark

DISCUSSION Tvrtko A. Uršulin 7 participants 11 messages Feb 17, 2004 – Feb 18, 2004

lore
Share & tools
lore
#0 lore raw

I did some quick benchmarks in case somebody is interested. Few words about the setup:

DOM1 64Mb RAM, vd:1 (4Gb on real /dev/sdb) DOM2 64Mb RAM, sda1 (4Gb mapped from real /dev/sdc5)

sdb is configured with only two VD's (4Gb root + 128Mb swap) so that in both cases partitions lay at the beginning of the physical disk. I suspect at least, because I don't know how VD code allocates space. sdc also has only two phy partitions with the same setup.

Both have identical root fs-s.

Single run is done while other domains sit idle. Concurrent run is both domain running bonnie++, well, concurrently :)

It seems that phy is significantly faster than vd, and that concurrent i/o load on separate disks doesn't hurt performace.

Detailed log attached.

xen:~ # bonnie++ -d /tmp -s 256 -u nobody
Using uid:65534, gid:65533.
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version 1.01d ------Sequential Output------ --Sequential Input- --Random-

                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
xen            256M 59542  57 67332  23 14097   3 41517  25 61763   8 246.2   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  3052  95 +++++ +++ +++++ +++  3492  98 +++++ +++ 12457 100

xen,256M,59542,57,67332,23,14097,3,41517,25,61763,8,246.2,0,16,3052,95,+++++,+++,+++++,+++,3492,98,+++++,+++,12457,100

xen:~ # bonnie++ -d /tmp -s 256 -u nobody
Using uid:65534, gid:65533.
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version 1.01d ------Sequential Output------ --Sequential Input- --Random-

                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
xen            256M 37163  26 39026  10 15921   4 38466  24 37099   3 235.2   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  3224  98 +++++ +++ +++++ +++  3621  99 +++++ +++ 11057  95

xen,256M,37163,26,39026,10,15921,4,38466,24,37099,3,235.2,0,16,3224,98,+++++,+++,+++++,+++,3621,99,+++++,+++,11057,95

xen:~ # bonnie++ -d /tmp -s 256 -u nobody
Using uid:65534, gid:65533.
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version 1.01d ------Sequential Output------ --Sequential Input- --Random-

                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
xen            256M 54668  40 54367  13 27525   6 61607  34 65226   5 249.8   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  3340  99 +++++ +++ +++++ +++  3574  99 +++++ +++ 10873  99

xen,256M,54668,40,54367,13,27525,6,61607,34,65226,5,249.8,0,16,3340,99,+++++,+++,+++++,+++,3574,99,+++++,+++,10873,99

xen:~ # bonnie++ -d /tmp -s 256 -u nobody
Using uid:65534, gid:65533.
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version 1.01d ------Sequential Output------ --Sequential Input- --Random-

                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
xen            256M 38234  39 37377   8 14809   4 37686  23 39310   4 224.5   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  3407  97 +++++ +++ +++++ +++  3514  99 +++++ +++ 10478  97

xen,256M,38234,39,37377,8,14809,4,37686,23,39310,4,224.5,0,16,3407,97,+++++,+++,+++++,+++,3514,99,+++++,+++,10478,97

#1 lore raw

Cool! Thanks for the info - there haven't been any benchmarks on virtual disks yet, so it's good to have some figures.

A couple of comments:

VD space has probably been allocated at the end of the drive, not the start. The VD management layer tries to allocate new space from the end (not the start) of the longest expired disk, first.

The idea behind this was to preserve any meta data at the start of the expired disk being scavenged from, in case of a future option for "partial undeletion" of expired disks whose space has been reallocated. In practice, I suspect most filesystems people will use are a little cleverer in terms of where they place their metadata, so this may not actually help much.

I suspect you might be able to increase the performance by using a different extent size. The VD management code allocates extents of "initialised" physical disks. The extent size for a device can be specified when it's initialised. The default is 64 megabytes. A 4 gigabyte virtual disk would make for 64 extents of 64 meg. A long list of extents could be slowing down the disk address translation in Xen, resulting in poorer benchmark results. At some stage I might rethink the default extent size.

If you want, you could try a larger extent size by specifying it at initialisation time. [ you can't change the extent size on an already initialised device :-( ]. This might speed things up in the benchmark, although if you don't allocate space in multiples of the extent size there will be more space in unused "partial extents" than for a smaller extent size.

In the degenerate case that your entire virtual disk fits inside an extent, it should give exactly the same performance as for the phy case (since the code will be doing exactly the same thing).

If I get some spare time I might test this out myself - right now I'm debugging a different problem.

Cheers,

Mark

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#2 lore raw
Quoted 7 lines

I suspect you might be able to increase the performance by using a different extent size. The VD management code allocates extents of "initialised" physical disks. The extent size for a device can be specified when it's initialised. The default is 64 megabytes. A 4 gigabyte virtual disk would make for 64 extents of 64 meg. A long list of extents could be slowing down the disk address translation in Xen, resulting in poorer benchmark results. At some stage I might rethink the default extent size.

The correct fix is to get rid of the linear linked lists.

A good way to do this is to use a buddy allocator for allocating VDs:
you track power-of-two multiples of 64MB free disc space, and try to create VDs out of the largest possible extents. Within Xen you can then use a truncated radix tree to map virtual extents to real extents --- Linux has code we can use for truncated radix trees.

-- Keir

Quoted 19 lines

If you want, you could try a larger extent size by specifying it at initialisation time. [ you can't change the extent size on an already initialised device :-( ]. This might speed things up in the benchmark, although if you don't allocate space in multiples of the extent size there will be more space in unused "partial extents" than for a smaller extent size.

In the degenerate case that your entire virtual disk fits inside an extent, it should give exactly the same performance as for the phy case (since the code will be doing exactly the same thing).

If I get some spare time I might test this out myself - right now I'm debugging a different problem.

Cheers,

Mark

Quoted 9 lines

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Xen-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#4 lore raw
In reply to Mark Williamson
Quoted 9 lines

I suspect you might be able to increase the performance by using a different extent size. The VD management code allocates extents of "initialised" physical disks. The extent size for a device can be specified when it's initialised. The default is 64 megabytes. A 4 gigabyte virtual disk would make for 64 extents of 64 meg. A long list of extents could be slowing down the disk address translation in Xen, resulting in poorer benchmark results. At some stage I might rethink the default extent size.

Quoted 5 lines

If you want, you could try a larger extent size by specifying it at initialisation time. [ you can't change the extent size on an already initialised device :-( ]. This might speed things up in the benchmark, although if you don't allocate space in multiples of the extent size there will be more space in unused "partial extents" than for a smaller extent size.

Any difference in performance must surely be down to the physical position of the data on the disk (and hence transfer rate): 64MB extents are sufficiently big not to introduce many extra seeks in a transfer, even if they weren't contiguous, which they likely are. The fact that we have to search a linked list of 64 extents for every transfer is pretty naive, but hardly likely to take long enough to actually produce a noticeable slowdown.

I think the likely problem is that vdtool is populating the disk from the last sector, so you're getting the slow bit of the disk first. The fact that each of the extents are effectively in the wrong order probably isn't giving Xen's disk scheduler optimal performance either.

Mark: could you initialise the free list on a newly created VD partition 'backwards' so we allocate from the front and sequentially allocated extents are forward on disk?

Thanks,
Ian

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#3 lore raw
In reply to Keir Fraser
Quoted 7 lines

The correct fix is to get rid of the linear linked lists.

A good way to do this is to use a buddy allocator for allocating VDs:
you track power-of-two multiples of 64MB free disc space, and try to create VDs out of the largest possible extents. Within Xen you can then use a truncated radix tree to map virtual extents to real extents --- Linux has code we can use for truncated radix trees.

That's a really cool idea! Thanks, Keir :-)

I'll stick it on my todo list to implement in a future release, time permitting. In the meantime, perhaps Ian's suggestion will give some decent improvements... (see later e-mail).

Cheers,

Mark

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#5 lore raw
In reply to Ian Pratt

OK, thanks Ian. Changes now made to the 1.2 repository and pushed to bkbits. Hopefully this should improve things a bit. Obviously, you'll have to use the slow bits of the disk eventually but it makes sense not to use it first ;-)

If anyone's interested in trying a comparative benchmark now, they'd be very welcome!

Mark

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#6 lore raw
Quoted 4 lines · Mark Williamson

OK, thanks Ian. Changes now made to the 1.2 repository and pushed to bkbits. Hopefully this should improve things a bit. Obviously, you'll have to use the slow bits of the disk eventually but it makes sense not to use it first ;-)

Will this break existing VD-s?

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#7 lore raw

Some thoughts about the soft real time scheduler for Xen

In reply to Ian Pratt

Hi Xen guys,

Frist, a (partial) recap of what Ian said before:

======================================
We need a compile (or run time) option to completely replace the current BVT scheduler with a soft real time scheduler that allows domains to be given guarantees of the form "x microseconds every y microseconds" (having a constraint that y must be a power of 2 or suchlike would be fine)

If there's CPU time left over after meeting the guarantees of all the runnable domains, it should be shared out in a proportional manner between domains that have an 'eligible for best-effort extra time' flag set.
======================================

Some questions:

1. According to the "2003 Xenoserver Computing Infrastructure", in a
commercial production environment clients are supposed to "buy" the computing time from Xenoserver, customers may not be happy with only soft real time QoS?

2. I am working on a (simple) absolute share scheduler function in Xen,
which should provide the bottom line for what a customer buy from Xenoserver. But I guess a hybrid scheduler combining these two is desirable in the future?

3. For a Xenolinux (domain) to specify meaningful QoS requests, it has
to gather information from application processes and inform them to Xen. In the literature there are serveral approaches such as directly modifying the kernel scheduler to be fully preemptible (preserving original interface), implementing new extension as module, using " dual kernels" by providing a thin layer between Linux kernel and interrupt control hardward (real time tasks interact with another [real time] kernel interface). Xen shows properties like some of these in the way that it sits below standard Linux like "dual kernel", and, that application processes run unmodified. Besides Xen's scheduler, the schduler in Xenolinux needs to be changed. Any idea how this should be implemented in Xenolinux? Which approach is more appropriate?

Any comments are welcomed.

Thanks,
Yan-Ching CHU

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#8 lore raw

Re: Some thoughts about the soft real time scheduler for Xen

Quoted 16 lines

Frist, a (partial) recap of what Ian said before:

======================================
We need a compile (or run time) option to completely replace the current BVT scheduler with a soft real time scheduler that allows domains to be given guarantees of the form "x microseconds every y microseconds" (having a constraint that y must be a power of 2 or suchlike would be fine)

If there's CPU time left over after meeting the guarantees of all the runnable domains, it should be shared out in a proportional manner between domains that have an 'eligible for best-effort extra time' flag set.
======================================

Quoted 6 lines

Some questions:

1. According to the "2003 Xenoserver Computing Infrastructure", in a
commercial production environment clients are supposed to "buy" the computing time from Xenoserver, customers may not be happy with only soft real time QoS?

In the context of XenoServers, the notion is that you pay for e.g. S ms every P ms, where the total demand from all domains clearly needs to be less than e.g. 100% assuming EDF.

However: if there is K% of the CPU remaining, we would like to be able to choose whether to dole this out to some subset of all domains, or to simply 'waste' it. The subset sharing the 'slack time' may or may not include any paying customers (e.g. it might involve running maintenance tasks for the XenoServer).

In the non-XenoServer case (e.g. more traditional web hosting world), the use of a work conserving scheduler seems to make lots of sense. A scheduler which allows both these extremes (hard QoS & best effort) would hence we a very nice thing.

Quoted 4 lines

2. I am working on a (simple) absolute share scheduler function in Xen,
which should provide the bottom line for what a customer buy from Xenoserver. But I guess a hybrid scheduler combining these two is desirable in the future?

Yup!

Quoted 11 lines

3. For a Xenolinux (domain) to specify meaningful QoS requests, it has
to gather information from application processes and inform them to Xen. In the literature there are serveral approaches such as directly modifying the kernel scheduler to be fully preemptible (preserving original interface), implementing new extension as module, using " dual kernels" by providing a thin layer between Linux kernel and interrupt control hardward (real time tasks interact with another [real time] kernel interface). Xen shows properties like some of these in the way that it sits below standard Linux like "dual kernel", and, that application processes run unmodified. Besides Xen's scheduler, the schduler in Xenolinux needs to be changed. Any idea how this should be implemented in Xenolinux? Which approach is more appropriate?

So in principle a XenoLinux (or other guest) scheduler could certainly export some 'real-time' scheduling notions to its hosted processes. However this is not at all a requirement for us; in particular our experience with Nemesis showed that the sorts of QoS requirements people actually have in general are rather coarse... e.g. some notion of "an aggregate machine which is about 15% as powerful as a the real one". We'd like to support higher-level QoS specs (e.g. "a machine which is capable of scoring 225 on SPEC WEb99") and have a plan for this. But none of this involves tweaking any of the scheduling in XenoLinux or other guests.

cheers,

S.

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#10 lore raw

Re: Some thoughts about the soft real time scheduler for Xen

In reply to Yan-Ching CHU
Quoted 11 lines · Yan-Ching CHU

Hi Xen guys,

Frist, a (partial) recap of what Ian said before:

======================================
We need a compile (or run time) option to completely replace the current BVT scheduler with a soft real time scheduler that allows domains to be given guarantees of the form "x microseconds every y microseconds" (having a constraint that y must be a power of 2 or suchlike would be fine)

Quoted 4 lines

If there's CPU time left over after meeting the guarantees of all the runnable domains, it should be shared out in a proportional manner between domains that have an 'eligible for best-effort extra time' flag set.

Can I suggest looking up "hierarchical scheduling" in general, and this paper in particular: <http://citeseer.nj.nec.com/regehr01hls.html>.

David Hopwood <[email protected]>

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#9 lore raw

Re: Some thoughts about the soft real time scheduler for Xen

In reply to Steven Hand

Thanks Steven that really clarified things a lot.

Yan-Ching CHU

----- Original Message -----
From: "Steven Hand" <[email protected]>
To: "Yan-Ching CHU" <[email protected]>
Cc: "Ian Pratt" <[email protected]>; <[email protected]>
Sent: Wednesday, February 18, 2004 6:49 PM
Subject: Re: [Xen-devel] Some thoughts about the soft real time scheduler for Xen

Quoted 16 lines
Quoted 16 lines

Frist, a (partial) recap of what Ian said before:

======================================
We need a compile (or run time) option to completely replace the current BVT scheduler with a soft real time scheduler that allows domains to be given guarantees of the form "x microseconds every y microseconds" (having a constraint that y must be a power of 2 or suchlike would be fine)

If there's CPU time left over after meeting the guarantees of all the runnable domains, it should be shared out in a proportional manner between domains that have an 'eligible for best-effort extra time' flag set.
======================================

Quoted 5 lines
Quoted 5 lines

Some questions:

1. According to the "2003 Xenoserver Computing Infrastructure", in a
commercial production environment clients are supposed to "buy" the computing time from Xenoserver, customers may not be happy with only

soft

Quoted 12 lines
Quoted 1 line

real time QoS?

In the context of XenoServers, the notion is that you pay for e.g. S ms every P ms, where the total demand from all domains clearly needs to be less than e.g. 100% assuming EDF.

However: if there is K% of the CPU remaining, we would like to be able to choose whether to dole this out to some subset of all domains, or to simply 'waste' it. The subset sharing the 'slack time' may or may not include any paying customers (e.g. it might involve running maintenance tasks for the XenoServer).

Quoted 6 lines

In the non-XenoServer case (e.g. more traditional web hosting world), the use of a work conserving scheduler seems to make lots of sense. A scheduler which allows both these extremes (hard QoS & best effort) would hence we a very nice thing.

Quoted 1 line

2. I am working on a (simple) absolute share scheduler function in

Xen,

Quoted 2 lines
Quoted 2 lines

which should provide the bottom line for what a customer buy from Xenoserver. But I guess a hybrid scheduler combining these two is

desirable

Quoted 5 lines
Quoted 1 line

in the future?

Yup!

Quoted 1 line

3. For a Xenolinux (domain) to specify meaningful QoS requests, it

has

Quoted 1 line
Quoted 1 line

to gather information from application processes and inform them to Xen.

In

Quoted 1 line
Quoted 1 line

the literature there are serveral approaches such as directly modifying

the

Quoted 1 line
Quoted 1 line

kernel scheduler to be fully preemptible (preserving original

interface),

Quoted 1 line
Quoted 1 line

implementing new extension as module, using " dual kernels" by providing

a

Quoted 1 line
Quoted 1 line

thin layer between Linux kernel and interrupt control hardward (real

time

Quoted 2 lines
Quoted 2 lines

tasks interact with another [real time] kernel interface). Xen shows properties like some of these in the way that it sits below standard

Linux

Quoted 1 line
Quoted 1 line

like "dual kernel", and, that application processes run unmodified.

Besides

Quoted 1 line
Quoted 1 line

Xen's scheduler, the schduler in Xenolinux needs to be changed. Any idea

how

Quoted 1 line
Quoted 1 line

this should be implemented in Xenolinux? Which approach is more

appropriate?

Quoted 17 lines

So in principle a XenoLinux (or other guest) scheduler could certainly export some 'real-time' scheduling notions to its hosted processes. However this is not at all a requirement for us; in particular our experience with Nemesis showed that the sorts of QoS requirements people actually have in general are rather coarse... e.g. some notion of "an aggregate machine which is about 15% as powerful as a the real one". We'd like to support higher-level QoS specs (e.g. "a machine which is capable of scoring 225 on SPEC WEb99") and have a plan for this. But none of this involves tweaking any of the scheduling in XenoLinux or other guests.

cheers,

S.

Quoted 10 lines

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Xen-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click