From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Bareiro Subject: Re: Swap usage with KVM Date: Tue, 20 Jul 2010 12:04:21 -0300 Message-ID: <20100720150421.GM26223@defiant.freesoftware> References: <20100711151257.GA13279@defiant.freesoftware> <20100711220858.GE9267@defiant.freesoftware> Reply-To: dbareiro@gmx.net Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0FM4RQAc0jwHekq5" Cc: dbareiro@gmx.net To: KVM General Return-path: Received: from mailout-de.gmx.net ([213.165.64.23]:36100 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1758194Ab0GTPE3 (ORCPT ); Tue, 20 Jul 2010 11:04:29 -0400 Content-Disposition: inline In-Reply-To: <20100711220858.GE9267@defiant.freesoftware> Sender: kvm-owner@vger.kernel.org List-ID: --0FM4RQAc0jwHekq5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sunday, 11 July 2010 19:08:58 -0300, Daniel Bareiro wrote: > > > I have an installation with Debian GNU/Linux 5.0.4 amd64 with > > > qemu-kvm 0.12.3 compiled with the source code obtained from the > > > official site of KVM and Linux 2.6.32.12 compiled from source code > > > of kernel.org. All this is installed on an HP Proliant DL380 G6 > > > with two Xeon E5530 quadcore processors and 16 GiB of RAM which > > > has two VMs with the following configuration of memory: > > Are you using virtio drivers in the VMs? > >=20 > > There was an issue with KVM-72 and virtio that leaks memory in the > > host until all RAM and swap is used (inside the VMs, no swap is > > used). It was supposed to be fixed in KVM-80-something, though. > >=20 > > Perhaps something similar is happening again? If you switch the > > disks to scsi instead of virtio, does the problem go away? > >=20 > > We are running KVM-72 on Debian 5.0 and have run into this issue. > > We'll be upgrading our hosts this month to fix this. > Yes, we are using Virtio drivers for networking and storage in both > VMs with cache=3Dnone. Both VMs are running Linux 2.6.32-bpo.5-amd64 > from Lenny Backports repositories. For VMHost, we are using a stable > version of KVM with Linux 2.6.32.12 compiled from source code of > kernel.org and qemu-kvm 0.12.3 compiled with the source code obtained > from the official site of KVM. >=20 > This is the syntax I'm using to boot the virtual machines: >=20 >=20 > 8587 ? Sl 6515:25 /usr/local/qemu-kvm/bin/qemu-system-x86_64 -d= rive > file=3D/dev/vm/aps4-raiz,cache=3Dnone,if=3Dvirtio,boot=3Don -drive > file=3D/dev/vm/aps4-cache,cache=3Dnone,if=3Dvirtio -drive file=3D/dev/vm/= aps4-index,cache=3Dnone,if=3Dvirtio > -drive file=3D/dev/vm/aps4-space,cache=3Dnone,if=3Dvirtio -m 7168 -smp 4 = -net > nic,model=3Dvirtio,macaddr=3D00:16:3e:00:00:95 -net tap -daemonize -vnc := 3 -k es -localtime -monitor > telnet:localhost:4003,server,nowait -serial telnet:localhost:4043,server,= nowait >=20 > 9769 ? Rl 11968:47 /usr/local/qemu-kvm/bin/qemu-system-x86_64 -= drive > file=3D/dev/vm/leela-raiz,cache=3Dnone,if=3Dvirtio,boot=3Don -drive > file=3D/dev/vm/leela-u01,cache=3Dnone,if=3Dvirtio -drive file=3D/dev/vm/l= eela-u02,cache=3Dnone,if=3Dvirtio > -drive file=3D/dev/vm/leela-u03,cache=3Dnone,if=3Dvirtio -drive > file=3D/dev/vm/leela-u04,cache=3Dnone,if=3Dvirtio -drive file=3D/dev/vm/l= eela-u05,cache=3Dnone,if=3Dvirtio > -drive file=3D/dev/vm/leela-u06,cache=3Dnone,if=3Dvirtio -drive > file=3D/dev/vm/leela-u07,cache=3Dnone,if=3Dvirtio -drive file=3D/dev/vm/l= eela-u08,cache=3Dnone,if=3Dvirtio > -drive file=3D/dev/vm/leela-u09,cache=3Dnone,if=3Dvirtio -drive > file=3D/dev/vm/leela-space,cache=3Dnone,if=3Dvirtio -m 7168 -smp 8 -net > nic,model=3Dvirtio,macaddr=3D00:16:3e:00:00:96 -net tap -daemonize -vnc := 4 -k es -localtime -monitor > telnet:localhost:4004,server,nowait -serial telnet:localhost:4044,server,= nowait > To make the switch from Virtio to SCSI I would have to shut down the > hosts, which would not be a good idea whereas are two productive > systems. At least, before doing so I would be sure of what might be > the problem. >=20 > Taking a current measurement in VMHost with free, I got the following: >=20 >=20 > ss04:~# free > total used free shared buffers cached > Mem: 16461588 16406504 55084 0 2920 21504 > -/+ buffers/cache: 16382080 79508 > Swap: 2028492 983140 1045352 >=20 >=20 > It draws attention to me that thinking about initially leaving a margin > of 2 GB of RAM for the VMHost, already it has used almost half of swap. This is a current measurement I've taken in both the VMs and in VMHost: * VMHost: ss04:~# free total used free shared buffers cached Mem: 16461588 16405140 56448 0 3496 18604 -/+ buffers/cache: 16383040 78548 Swap: 5174220 2401552 2772668 * Aps4: aps4:~# free total used free shared buffers cached Mem: 7164300 7120192 44108 0 23108 239076 -/+ buffers/cache: 6858008 306292 Swap: 2931820 14084 2917736 * Leela: leela:~# free total used free shared buffers cached Mem: 7163836 6905224 258612 0 123380 6282816 -/+ buffers/cache: 499028 6664808 Swap: 979924 35640 944284 As you can see, I added more swap in VMHost for more margin, but currently only 54% is free. Thanks in advance for your replies. Regards, Daniel --=20 Fingerprint: BFB3 08D6 B4D1 31B2 72B9 29CE 6696 BF1B 14E6 1D37 Powered by Debian GNU/Linux Lenny - Linux user #188.598 --0FM4RQAc0jwHekq5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkxFuvUACgkQZpa/GxTmHTf1nQCfSl7IlmXVGm+UOR/Tb68RiPfo 5rgAn27q/k8sK+OOPwgo2KO/vsQuH/W5 =hG68 -----END PGP SIGNATURE----- --0FM4RQAc0jwHekq5--