WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] crazy SWAP and RAM idea

To: SH Solutions <info@xxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] crazy SWAP and RAM idea
From: Luke Crawford <lsc@xxxxxxxxx>
Date: Fri, 8 Sep 2006 10:28:23 -0700 (PDT)
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 08 Sep 2006 10:29:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <001a01c6d2c4$4bcd8160$0b4613ac@shs1>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <001a01c6d2c4$4bcd8160$0b4613ac@shs1>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx

First off, let me say that I think virtuoso-style RAM oversubscription is a bad idea.

That said, if you wanted to implement virtuoso style oversubscription in Xen, clearly the way to do it is with the balloon driver. With no code changes to xen, you can do it like this: boot each domain serially with 512M ram or whatever you want the max ram to be, then use xm mem-set to bring them down to 32M or whatever you want the minimum to be, then boot the next domain and balloon it down, etc.... You might be able to get the same effect by booting everything with memory=32 in the xm config file, and a boot option of maxmem=512M, but I'm not as sure about that.

Next, somehow detect what domains need more ram, and xm mem-set them up until you are utilizing all available ram. (maybe iostat on the swap partition? something like that?)

I still think it's a bad idea, but it could be done with nothing more than a re-write of your xendomains startup script and some sort of monitoring process to tweek the balloons.

the problems with this setup are unavoidable in a shared-ram setup. The thing is, UNIX is designed to eat all available ram. If you change this, performance will degrade. I guess if you had a nice, fast disk system, and your balloon script was only setup to take ram from systems that had enough 'free' or 'buff' ram to satisfy the request it might work okay. (ram used as 'write-through' cache can be freed almost immediately, whereas ram used to store other inactive memory pages, or write-back cache must be flushed to disk before freeing, a slow process. this would have worked much better back in the day when everyone used write-through- modern ordered metadata write filesystems operate more like write-back caches, so this won't work as well anymore)

The other problem is one of business model; if you give heavy users better service than light users, and you charge the same for both, in a rational market, all the light users would switch to a provider where they didn't have to subsidize the heavy users. you would be stuck with only the heavy users, with nobody left to subsidize the system.

 On Thu, 7 Sep 2006, SH Solutions wrote:

Date: Thu, 7 Sep 2006 23:26:35 +0200
From: SH Solutions <info@xxxxxxxxxxxxxxx>
To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] crazy SWAP and RAM idea

Hi

I've been thinking about the following:

As every domU has it's own RAM, I cannot give as much memory to each domU,
as I wanted to.
So I gave them swap. That's LVM-backed.
But now, each domain that exceeds it's memory needs to swap pages in and
out, while other domains might not need their memory.

The idea to solve this, is a follows:

1. Give every domU as few memory as possible. (16MB?)
2. Give dom0 a huge fast swap space (several GB?)
3. Create a "RAMDRIVE" in dom0 in that swap.
4. Create domU's swap partitions on dom0's ramdrive.

The reason would be that dom0 can now "really" swap in pages as *REALLY*
needed from/to harddrive.
DomU's would then "only" swap from/to a partition that really is RAM and as
such really fast.

Seems a little crazy idea, but a way to make swaping more sensfull.

What do you think?

Regards,
 Steffen


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