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

Re: [Xen-users] Memory overcommitment in Xen.



WebDawg <webdawg@xxxxxxxxx> wrote:

> I have a question for you.  I use Xen Orchestra and Xen.  I assume this is a 
> Xen bug but every once in a while, upon domU creation, the creation memory 
> settings will be corrupt.  I get something like this:
> 
> Static:  128 MiB/ 2 GiB
> Dynamic:  2 GiB/ 4 GiB
> 
> This will cause 100% CPU use and a very slow VM.  I have seen corrupt 
> settings like this too:
> 
> Static:  128 MiB/ 2 GiB
> Dynamic:  2 GiB/ 1 TiB
>  
> Which is just ridiculous.  I cannot set these settings via command line and 
> it appears to be a bug somewhere but this is not my point.
> 
> The question I have is:  what really happens inside of xen when you try and 
> start something like this?

I suggest reading through 
https://blog.xenproject.org/2014/02/14/ballooning-rebooting-and-the-feature-youve-never-heard-of/
 to start with.

I'm not quite clear what you're saying, when you say "Static:  128 MiB/ 2 GiB", 
do you mean you've configured the system to start the guest with 2G allocated, 
but ballooned down to 128M ? And "Dynamic:  2 GiB/ 1 TiB" means the guest was 
actually started with 1T allocated but ballooned down to 2G ?

If so, then especially with the latter, I imagine an awful lot of work is going 
on - especially if the guest scrubs it's memory during boot. From the above 
page, you'll see that as the guest accesses each page of memory, a page from 
the free pool is allocated to it. Then the host must check each page, and if it 
contains zeroes, take it back and put it back in the free pool - this will 
either happen as pages are allocated from the free pool (checks recently 
allocated pages to see if they are all zeroes), or when the host runs out of 
free memory and has to go looking for some to free up.
For a while, this will result in heavy CPU use - you've a lot of memory that's 
being shuffled around, zeroes written to it by the guest, then the host checks 
to see if it's all zeroes so it can claim it back. Then when the guest gets as 
far as actually loading the balloon driver, the ballon driver must make memory 
allocation requests until it's taken back enough ram from the guest to get 
usage down to the running value you've specified (and I assume, hope !, that 
for security these pages get scrubbed before re-use).

Hopefully I've not spouted forth a load of rubbish !


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
https://lists.xen.org/xen-users

 


Rackspace

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