Hi, guys -- We make fairly extensive use of Xen on our QA and testing platform. We like to pseudo-physically separate apache instances running different release candidates of our software. This works well. However, we could do with more ram in our ''child'' virtual machines. We have 4GB on each host computer. We like to install 10 or so virtual machines on each host. This leaves each VM very resource starved. Since we only tend to hit environments on an ad-hoc basis, we need the vms available, but a lot of resources get wasted as they tend to be hit one after the other. Ideally, we''d like to content system ram - so each machine is configured to have 1GB available. This obviously means we need to contend memory .. probably 3:1 (including the requirements of the Dom-0). Is this possible ? cheers -a (sample config file from oru setup below) kernel = "/boot/vmlinuz-2.6.12.6-xenU" memory = 256 name = "qa01" vif = [ ''ip=10.22.22.101'' ] disk = [''file:/vm/p1/qa01.img,hda1,w'',''file:/vm/p1/qa01.swap,hda2,w''] netmask="255.255.254.0" gateway="10.0.12.1" root = "/dev/hda1" extra = "4" _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I don''t think you can make Xen overcommit RAM.>From what I understand the amount of RAM you allocate for a VM must bephysically available. Andy Davidson wrote:> > > Hi, guys -- > > We make fairly extensive use of Xen on our QA and testing platform. > We like to pseudo-physically separate apache instances running > different release candidates of our software. > > This works well. However, we could do with more ram in our ''child'' > virtual machines. > > We have 4GB on each host computer. We like to install 10 or so > virtual machines on each host. This leaves each VM very resource > starved. Since we only tend to hit environments on an ad-hoc basis, > we need the vms available, but a lot of resources get wasted as they > tend to be hit one after the other. > > Ideally, we''d like to content system ram - so each machine is > configured to have 1GB available. This obviously means we need to > contend memory .. probably 3:1 (including the requirements of the > Dom-0). Is this possible ? > > cheers > -a > > > (sample config file from oru setup below) > > kernel = "/boot/vmlinuz-2.6.12.6-xenU" > memory = 256 > name = "qa01" > vif = [ ''ip=10.22.22.101'' ] > disk = [''file:/vm/p1/qa01.img,hda1,w'',''file:/vm/p1/qa01.swap,hda2,w''] > netmask="255.255.254.0" > gateway="10.0.12.1" > root = "/dev/hda1" > extra = "4" > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users-- Yuri Pismerov, System Administrator Armor Technologies (Canada) Inc. P: 905 305 1946 (x.3519) http://www.armorware.net Privacy Protection Guaranteed! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Andy Davidson wrote:> > > Hi, guys -- > > We make fairly extensive use of Xen on our QA and testing platform. > We like to pseudo-physically separate apache instances running > different release candidates of our software. > > This works well. However, we could do with more ram in our ''child'' > virtual machines. > > We have 4GB on each host computer. We like to install 10 or so > virtual machines on each host. This leaves each VM very resource > starved. Since we only tend to hit environments on an ad-hoc basis, > we need the vms available, but a lot of resources get wasted as they > tend to be hit one after the other. > > Ideally, we''d like to content system ram - so each machine is > configured to have 1GB available. This obviously means we need to > contend memory .. probably 3:1 (including the requirements of the > Dom-0). Is this possible ?maxmem = 1024 memory = 256 When it comes time to use the VM you care about, use xm mem-set to increase it''s memory to 1G (and after you''re finished, decrease it back down to 256). Regards, Anthony Liguori> cheers > -a > > > (sample config file from oru setup below) > > kernel = "/boot/vmlinuz-2.6.12.6-xenU" > memory = 256 > name = "qa01" > vif = [ ''ip=10.22.22.101'' ] > disk = [''file:/vm/p1/qa01.img,hda1,w'',''file:/vm/p1/qa01.swap,hda2,w''] > netmask="255.255.254.0" > gateway="10.0.12.1" > root = "/dev/hda1" > extra = "4" > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On 31 May 2006, at 20:37, Anthony Liguori wrote:> Andy Davidson wrote: >> Ideally, we''d like to content system ram - so each machine is >> configured to have 1GB available. This obviously means we need to >> contend memory .. probably 3:1 (including the requirements of the >> Dom-0). Is this possible ? > maxmem = 1024 > memory = 256 > When it comes time to use the VM you care about, use xm mem-set to > increase it''s memory to 1G (and after you''re finished, decrease it > back down to 256).Many thanks for replying. I see; this isn''t possible to do dynamically ? -a _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Andy Davidson wrote:> > On 31 May 2006, at 20:37, Anthony Liguori wrote: > >> Andy Davidson wrote: >>> Ideally, we''d like to content system ram - so each machine is >>> configured to have 1GB available. This obviously means we need to >>> contend memory .. probably 3:1 (including the requirements of the >>> Dom-0). Is this possible ? >> maxmem = 1024 >> memory = 256 >> When it comes time to use the VM you care about, use xm mem-set to >> increase it''s memory to 1G (and after you''re finished, decrease it >> back down to 256). > > Many thanks for replying. > > I see; this isn''t possible to do dynamically ?It requires manual intervention. As someone has previously mentioned, Xen does not support any concept of overcommit. Regards, Anthony Liguori> -a >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
AFAIK, having xen do virtual memory is out of the question... it would need all sorts of device drivers etc that are (as I understand it) purposely not part of xen. (e.g. xen doesn''t know what a disk is, let alone a SCSI/IDE/SATA driver is...) However. It seems to me, that you might be able to get dom0 to do this... How about creating a big tmpfs filesystem in dom0, putting some big files on that and exporting those to the various domU to use as swapdevices? Assuming it works, the effect should be something close to swapping to a ramdisk. Slower than running on real memory, but faster than swapping to disk. I don''t generally have much cause to work with sparse files, but I image the swapfiles could be initialized as sparse files, which would save a number of resources on startup. Anyone care to experiment and report back? -Tom On Wed, 31 May 2006, Anthony Liguori wrote:> Andy Davidson wrote: > > > > On 31 May 2006, at 20:37, Anthony Liguori wrote: > > > >> Andy Davidson wrote: > >>> Ideally, we''d like to content system ram - so each machine is > >>> configured to have 1GB available. This obviously means we need to > >>> contend memory .. probably 3:1 (including the requirements of the > >>> Dom-0). Is this possible ? > >> maxmem = 1024 > >> memory = 256 > >> When it comes time to use the VM you care about, use xm mem-set to > >> increase it''s memory to 1G (and after you''re finished, decrease it > >> back down to 256). > > > > Many thanks for replying. > > > > I see; this isn''t possible to do dynamically ? > > It requires manual intervention. As someone has previously mentioned, > Xen does not support any concept of overcommit. > > Regards, > > Anthony Liguori > > > -a > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >---------------------------------------------------------------------- tbrown@BareMetal.com | Put all your eggs in one basket and http://BareMetal.com/ | WATCH THAT BASKET! web hosting since ''95 | - Mark Twain _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, May 31, 2006 at 07:54:02PM +0100, Andy Davidson wrote:> We have 4GB on each host computer. We like to install 10 or so > virtual machines on each host. This leaves each VM very resource > starved. Since we only tend to hit environments on an ad-hoc basis, > we need the vms available, but a lot of resources get wasted as they > tend to be hit one after the other. > > Ideally, we''d like to content system ram - so each machine is > configured to have 1GB available. This obviously means we need to > contend memory .. probably 3:1 (including the requirements of the > Dom-0). Is this possible ?As others have said, Xen doesn''t overcommit memory. My guess is that the decision won''t be changed any time soon, either, as the big question is: what happens when everything *really* needs all that RAM? Bad Things, since the hypervisor has no idea about virtual memory / swap space. You can semi-automate the whole thing, though, by having some sort of tiny daemon that monitors some system parameter, and tells the hypervisor that it needs more RAM when it thinks it does. The simplest solution would just be a simple LRU scheme which held most VMs at 256MB, and gave the two VMs which most recently said "holy crap, I need RAM!" a full 1GB. More tricksyness could get you a block-request scheme, by the 256MB -- everyone starts with 256MB, and when it really runs out it asks for another 256MB, and so on -- again, you wouldn''t want to go beyond your 1GB limit, presumably. The difficult part in this is determining when a machine needs more RAM. I''d say that heavy I/O on the swap partition would be a good indication, but I''m not sure how to monitor that (It''s got to be *somewhere* in /proc, though). One thing that''s certain -- just monitoring how much RAM is consumed, or how much is allocated to processes, isn''t going to work, since things will tend to just gobble up everything they can anyway. You need a better metric than that. - Matt _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users