From: James Stevens Subject: Re: KVM and the OOM-Killer Date: Fri, 14 May 2010 09:10:19 +0100 Message-ID: <4BED056B.1080804@jrcs.co.uk> References: <4BEBEE8F.9050508@jrcs.co.uk> <20100514073334.GE16563@miggy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from mk-outboundfilter-4.mail.uk.tiscali.com ([212.74.114.32]:57379 "EHLO mk-outboundfilter-4.mail.uk.tiscali.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754017Ab0ENIKW (ORCPT ); Fri, 14 May 2010 04:10:22 -0400 Received: from [192.168.250.120] (James-PC.james [192.168.250.120]) (authenticated bits=0) by home.jrcs.co.uk (8.13.6/8.12.9) with ESMTP id o4E8AHg7012574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 14 May 2010 09:10:19 +0100 In-Reply-To: <20100514073334.GE16563@miggy.org> Sender: kvm-owner@vger.kernel.org List-ID: > echo "-16"> /proc//oom_adj Thanks for that - yes, I know about "oom_adj", but it doesn't (totally) work. "udevd" has a default of "-17" and it got killed anyway. Also, the only thing this server runs is VMs so if they can't be killed oom-killer will just run through the everything else (syslogd, sshd, klogd, udevd, hald, agetty etc) - so on balance its a case of which is worse? Without those daemons the system can become inaccessible and could become unstable, so on balance it may be better to let it kill the VMs. My current work-around is :- sync; echo 3 > /proc/sys/vm/drop_caches I run it once a week midday Sunday in a cron job. This drops all blocks from the disk cache, and free up pretty all of LOWMEM - which sounds terrible, but its not that bad as each VM has its own cache anyway. After running it I get ~2000 blocks/sec read for 1 minute, then ~20 to 50 blocks / sec read for the next few hours - which in terms of our disk RAID is nearly nothing. My "normal" level of disk reads is zero. BTW: I've had very good results with "-cpu host". Its reduced my context switching considerably - up to 50% on one server - and reduced disk i/o (not quite sure why!). James