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@lists.xensource.com http://lists.xensource.com/xen-users
Mauro wrote:>When creating a DomU I''ve always set a swap.So do I, but I guess it''s partly because "I''ve always done it that way">Do you think it is necessary to have a swap in the DomU?It''s as necessary as it would be on a non-virtualised machine with the same amount of memory and same workload. That is, if you need it then it''s necessary, if you don''t then it isn''t :-/ -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
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@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
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@lists.xensource.com > > http://lists.xensource.com/xen-users > > > > _______________________________________________ > 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 11 February 2011 11:38, Henrik Langos <hlangos-xen@innominate.com> wrote:> > > 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.That''s what I was thinking when ask if create a swap or not. If my system needs swap then it means that I need more ram. So it''s better to give more ram to my DomU rather than swap. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Fri, Feb 11, 2011 at 6:38 PM, Henrik Langos <hlangos-xen@innominate.com> wrote:> About balooning: AFAIK this only means taking memory away from dom0.No> DomU''s have a fixed amount of memory, don''t they?domU memory can shrink or grow (if setup corectly) from their initial value. There''s even a script (installed in domUs) that can do this automatically based on domU''s memory needs (don''t have the link handy right now), which would (from user''s perspective) allow Xen to overcommit memory. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On 11 February 2011 10:34, Simon Hobson <linux@thehobsons.co.uk> wrote:> Mauro wrote: >> >> When creating a DomU I''ve always set a swap. > > So do I, but I guess it''s partly because "I''ve always done it that way"I do the same. I''m using xen-tools package from debian squeeze and default configuration for swap is 2G. It''s too much I think but I''ve always left that value. With top I see that swap is not always used but for the most is cached: Tasks: 75 total, 1 running, 74 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 1066840k total, 310596k used, 756244k free, 11496k buffers Swap: 2097144k total, 0k used, 2097144k free, 215568k cached _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Fri, Feb 11, 2011 at 6:58 PM, Mauro <mrsanna1@gmail.com> wrote:> On 11 February 2011 11:38, Henrik Langos <hlangos-xen@innominate.com> wrote: >> >> >> 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. > > That''s what I was thinking when ask if create a swap or not. > If my system needs swap then it means that I need more ram. > So it''s better to give more ram to my DomU rather than swap.I still think swap is necessary, depends on the circumstances. For example, I have a server (running java) with 1.5G memory, and currently 134M swap usage. There has been no swap in/swap out activity (as monitored from vmstat), so whatever is using the memory is not actually using it at the moment. While this might be a sign of memory leak, currently I''m happy enough letting it use swap space as opposed to having to add more memory. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mauro wrote:>That''s what I was thinking when ask if create a swap or not. >If my system needs swap then it means that I need more ram. >So it''s better to give more ram to my DomU rather than swap.Indeed. It doesn''t really matter to the system whether it has 1G RAM + 1G Swap, or 2G RAM - both give it 2G of memory to play in. Ideally you want to give it real memory - as that''s much faster. But as Fajar points out, there tends to be stuff that is very seldom used and it''s no big deal to let it swap out and stay swapped out - and it''s generally cheaper to add disk space than memory. It''s a matter of balance. Your machine needs whatever memory it needs - so you have to give it at least that. It also has a minimum amount that must be real memory rather than swap if performance isn''t to be severely affected. Once you''ve met those two minima, then the rest is a matter of balancing cost and performance. Speed is a matter of money - how fast can you afford ! -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users