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

Fwd: Re: [Xen-users] Swap: create or not?

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Fwd: Re: [Xen-users] Swap: create or not?
From: George Shuklin <george.shuklin@xxxxxxxxx>
Date: Sun, 13 Feb 2011 04:59:05 +0300
Delivery-date: Sat, 12 Feb 2011 18:00:10 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:content-type; bh=SOWpHOVXU3/EIOeZI7HUCcIdlKcKGqas9SvT5TEmdPg=; b=RMRQx+ppHseIg9oNHqWF87PvdY5bNIVZgeXzrYLqZNKD23ZbFYuY1qSAKZjt+C1yj4 2qePJhqHFJaQqQNgehHCDYBNB+gt1RSaU245R64lJHNAsVMTRu5eTePdHac85rEz8oeC GBp6bV41eVePGV858CBZ66x/aeUcWymnnXlFg=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; b=xMFMTFpH1B5Y+yo/BY86KmNvbqL8vgbyyYzdNsIIShunhTb5zWfhk+d7wkPgJCdd42 6urYdXVeVmAiGgDUygvpUT2Hcsbu7DxW+3EY8T/hps0wJFi3lWGxImS4mTQBmnm4u9tt hoyodH9ewTdeeFhzGr8a4WfOvLOCfqzlHD10o=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101226 Icedove/3.0.11
I think I wrote not very clearly.

I say 'swap in domU will save in case lag or little mistake with balloon'. If course, there is no any kind of ballooning for dom0.

Right now we running pretty much VMs for our cloud services and we use heavy memory management (it grabs and gives memory with lag less then second depends on usage in customers VM). And we have some statistics for guest VM's memory usage: All VM with real load have they swap filled a little with really useless data, they do not read/write them any way (instead initial filling), the simply 'keep' them until shutdown.

Many or not - it about 30-100Mb per VM, wich coming out as about 40Gb of total (saved) memory for all guest VMs. This memory used as buffers/page cache and effectively reduce IO load on shared storage.

Second very important usage: when user processes starts to eat memory, it is some lag until we add more memory. Of couse every VM have some free memory, but in case it was not enough - swap will save guest VM from been OOMkilled.

So I strongly supports for domU swap.


-------- Original Message --------
Subject: Re: [Xen-users] Swap: create or not?
Date: Fri, 11 Feb 2011 12:38:50 +0100
From: Henrik Langos <hlangos-xen@xxxxxxxxxxxxxx>
To: George Shuklin <george.shuklin@xxxxxxxxx>
CC: xen-users@xxxxxxxxxxxxxxxxxxx


I'd argue against swap in domU if you can avoid it.

If your application needs that much more RAM you'll be better off
giving that VM more RAM instead.

If your application doesn't give a damn about memory usage, it 
will be the first on the oom-killer's menu. -> Problem solved. ;-)


If you allow the application to go deeply into swap, it 
will place some heavy IO load on your machine and thus bog down 
- every other application on that domU AND 
- every other domU including their applications AND
- your dom0 (very nasty if you need your dom0 to do IO to a SAN).

So, I'd say avoid swap if you can, and if you can't than keep it
to a minimum (lets say 256M).

About balooning: AFAIK this only means taking memory away from dom0.
DomU's have a fixed amount of memory, don't they?

Balooning for dom0?

I'd say: Avoid it like the plague! It will bog down your dom0 horribly
and the only reason I can see for using it, would be on a desktop where
ocassionally you use a xen domU.

For a server I strongly suggest following the best practices:
http://wiki.xensource.com/xenwiki/XenBestPractices

cheers
-henrik

On Fri, Feb 11, 2011 at 02:18:48PM +0300, George Shuklin wrote:
> Yes, swap is almost mandatory - it will save machine from state 'very
> low mem'. From my research (mostly on XCP) this state may cause
> unstability for some kernels, causing OOM_killer to kill many processes
> (sometimes including init - means kernel panic). Swap reducing chances
> to get to this state.
> 
> Second very important point: ballooning. When ballooning (inflating
> balloon = reduce mem) occur, if kernel have no free address space it can
> invoke OOM_killer. Swap will save in case slightly wrong values for
> balloon.
> 
> В Пт., 11/02/2011 в 10:12 +0000, Mauro пишет:
> > When creating a DomU I've always set a swap.
> > Do you think it is necessary to have a swap in the DomU?
> > 
> > _______________________________________________
> > Xen-users mailing list
> > Xen-users@xxxxxxxxxxxxxxxxxxx
> > http://lists.xensource.com/xen-users
> 
> 
> 
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users

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