[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-users] Number of domains versus memory usage


  • To: blj@xxxxxxxxxxxxxxxxxxx, xen-users@xxxxxxxxxxxxxxxxxxx
  • From: "Petersson, Mats" <mats.petersson@xxxxxxx>
  • Date: Fri, 23 Sep 2005 17:51:23 +0200
  • Delivery-date: Fri, 23 Sep 2005 15:57:48 +0000
  • List-id: Xen user discussion <xen-users.lists.xensource.com>
  • Thread-index: AcXAUzv5Hgzbm7ZNR+uslbUTq0oX9QAAVe6w
  • Thread-topic: [Xen-users] Number of domains versus memory usage

> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Brian Johnson
> Sent: 23 September 2005 16:34
> To: xen-users@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-users] Number of domains versus memory usage
> 
> Hey fellow xen'ers -
> 
> We are going to be setting up a new Xen server, my first, and 
> I have a question.  From what I have gathered reading through 
> the documentation, you are limited in the number of domains 
> you can have running by the amount of memory you have.  Our 
> server is going to be starting with 4GB of ram.  
> 
> Now, if we want to have domains with 1GB of ram, does this 
> mean we can only have 4 domains?  Or is there a more dynamic 
> way of doing this?  In other words, something like, "Domain1 
> can use up to 1GB of ram, Domain2 can use up to 2GB of ram, 
> Domain3 can use up to 4GB of ram".  And any time Domain3 
> needs 4GB, it can have it if it's free, otherwise it has to swap.  

You can let the Linux within each guest do swapping if you like, you
just need to give each one a swap-partition (which is really a file in
the Dom0 environment). 

A guest can then use the amount of memory it's been granted, and if it
needs more it will swap some stuff out to disk and deal with it just the
same way that a regular machine does when the total memory load is
bigger than the available memory... 

What isn't possible is for Xen to allocate/free memory and re-distribute
it automatically. Nor can Xen swap pages in or out.

So the total memory given to all guests at any given time is always
going to be less than the total amount of memory in the system [because
Xen itself takes some memory]. If you have 4GB of usuable ram after
booting, you can have four guests of 1GB each. Or one guest of 0.5GB,
and three of 1.0GB, and two of 0.25GB. If you have 4GB in the machine,
however, you'll need Xen 3.0 to make use of ALL of the RAM, because the
BIOS will steal some memory between 0-4GB to use for PCI address space,
and that will give a total memory AVAILABLE of about 3.3-3.8GB below
4GB. Xen 2.0 isn't able to use memory above 4GB. Xen 3.0 is currently in
"testing" mode, so it's not considered fully stable, but OK for testing
purposes. 

So in your example, using Xen 3.0, we'd probably come up with a
configuration like this: 

Domain 1: 900MB
Domain 2: 900MB
Domain 3: 900MB
Domain 4: 900MB

That leaves a couple of hundred megabytes for Xen + Dom0, which is
needed, because Dom0 is another copy of Linux, and it needs that sort of
memory if you want to do anything useful with it. Xen itself uses
something around 4-10MB, so not a huge amount. 

In Xen 2.0 it would be another 100MB or so less on each guest domain.
[Dom0 still needs to have the same amount of memory]. 

Of course, if one of your domains has something extra memory demanding
[say a database of several hundred megabytes that you want to keep in
memory at all times], then you could shuffle the memory allocation
around so that domain can use more memory, and the others get less.

[I started writing this using the word Guest, then changed to using the
word Domain. They are essentially interchangeable terms in the usage
above.]

--
Mats


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.