From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNocX-0001Mi-Q0 for qemu-devel@nongnu.org; Wed, 12 Mar 2014 15:15:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNocR-0005Z2-S2 for qemu-devel@nongnu.org; Wed, 12 Mar 2014 15:15:17 -0400 Received: from mail-ph.de-nserver.de ([85.158.179.214]:43495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNocR-0005Sv-J1 for qemu-devel@nongnu.org; Wed, 12 Mar 2014 15:15:11 -0400 Message-ID: <5320B25E.3040402@profihost.ag> Date: Wed, 12 Mar 2014 20:15:42 +0100 From: Stefan Priebe MIME-Version: 1.0 References: <52FA399F.6070802@profihost.ag> <52FA6C5E.1060300@profihost.ag> <20140214150345.GL17391@stefanha-thinkpad.redhat.com> <52FE5D71.6040704@profihost.ag> <20140224150058.GA23185@stefanha-thinkpad.hitronhub.home> <530B6FB4.3030001@redhat.com> In-Reply-To: <530B6FB4.3030001@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] memory allocation of migration changed? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Stefan Hajnoczi Cc: Orit Wasserman , Juan Quintela , Peter Lieven , qemu-devel , Dave Gilbert Am 24.02.2014 17:13, schrieb Eric Blake: > On 02/24/2014 08:00 AM, Stefan Hajnoczi wrote: > >>> What is the right way to check for enough free memory and memory >>> usage of a specific vm? >> >> I would approach it in terms of guest RAM allocation plus QEMU overhead: >> >> host_ram >= num_guests * guest_ram_size + num_guests * qemu_overhead >> >> The qemu_overhead is the question mark. It depends on the QEMU features >> the guests have enabled and number of devices. >> >> QEMU also does not have a strict policy on predictable memory >> consumption, which makes it hard to give a formula for it. > > In fact, at one point libvirt tried to put an automatic cap on the > memory usable by qemu by multiplying RAM size and accounting for a > margin of overhead, but no matter what heuristics we tried, we still got > complaints from users that their guests were killed when they ran out of > memory, and so we ended up reverting the automatic limits from libvirt. > (You can still enforce a limit as an end user, although the libvirt > documentation no longer recommends attempting that, for as long as the > qemu allocation remains unpredictable.) > Might something like: vm.overcommit_ratio=100 vm.overcommit_memory=2 help? So that the migration might not happen but that's better than killing a random process? Stefan