qemu-discuss
[Top][All Lists]
Advanced

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

Re: [Qemu-discuss] qemu-kvm swapping even though vm.swappiness = 0


From: Mike Lovell
Subject: Re: [Qemu-discuss] qemu-kvm swapping even though vm.swappiness = 0
Date: Fri, 23 May 2014 21:05:58 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/23/2014 02:39 AM, Horatiu N wrote:
on a 64gb ram node with 1gb swap i have swappiness=0
but still i see qemu-kvm swapping and when the swap fills (the kernel?) kills the pids

first off, just in case there is confusion, the vm in vm.swapiness is not for virtual machine but for virtual memory. its not anything specific to qemu or virtual machines.

setting swappiness to 0 does not mean the kernel wont use swap. "A value of 0 instructs the kernel not to initiate swap until the amount of free and file-backed pages is less than the high water mark in a zone" [1]. unfortunately, i didn't readily see how to determine what the high water mark for a zone is. i am pretty sure the only way to make it so the kernel never uses swap is to not provide the kernel with any.

i'm not sure if the data you provided is what is intended. it looks like the sysctl command showing vm.swapiness was run on a different system (node) than the free command (fr04). i don't know if one was a vm running on the host or something else.

this overall looks like behavior i would expect from what you are describing. is there an issue with your qemu guests being killed because the host is running out of memory? it does seem odd that the guests would be getting killed from the oom-killer (out-of-memory) from the info you've given but i'm not sure if that is the memory info from when the oom-killer is doing its thing. if it is then i'm guessing there are some tweaks you can make to the variables for the host virtual memory system. there are a number of options that are kind of black magic to me and i would recommend doing some searching and reading of docs around the oom-killer and other virtual memory options.

mike

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/sysctl/vm.txt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]