From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: 2 times more VMs withOUT KVM Date: Fri, 31 Jul 2015 09:54:11 +0200 Message-ID: <55BB29A3.4000802@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Pavel Shirshov , kvm@vger.kernel.org Return-path: Received: from mail-wi0-f174.google.com ([209.85.212.174]:38119 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752431AbbGaHyN (ORCPT ); Fri, 31 Jul 2015 03:54:13 -0400 Received: by wibxm9 with SMTP id xm9so20985190wib.1 for ; Fri, 31 Jul 2015 00:54:12 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 31/07/2015 01:08, Pavel Shirshov wrote: > Hello, > > Today I was very surprised to see that KVM with enabled HugePages uses > much more memory versus KVM without HugePages enabled. > > I have a server with 386Gb memory. > I have a VM image which allocate up to 3.2Gb memory (libvirt tag). > > Without HugePages enabled on the server I can create up to 235 VM on the server. > > With HugePages enabled I can create about 105 VMs on the same server. > I reserve 180000 2Mb pages on the server. > > I see that 180000*2Mb / 3.2 Gb = 112.5 VMs. > > How KVM without HugePages is able to create 235 VMs? Does KSM help? KVM without hugepages can overcommit. It can do this thanks to unused memory (never touched by the VM, thus all zero), swapping out, deduplication (KSM), ballooning or a combination of the four. Hugepages are never overcommitted. Paolo > Is it possible to tune KVM with HugePages up to support ~200 VMs? > > Thanks