Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0889710C46 for ; Sun, 27 Apr 2014 21:26:28 +0000 (UTC) Received: (qmail 96384 invoked by uid 500); 27 Apr 2014 21:26:27 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 96343 invoked by uid 500); 27 Apr 2014 21:26:26 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 96335 invoked by uid 99); 27 Apr 2014 21:26:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Apr 2014 21:26:26 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of laszlo.hornyak@gmail.com designates 209.85.216.54 as permitted sender) Received: from [209.85.216.54] (HELO mail-qa0-f54.google.com) (209.85.216.54) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Apr 2014 21:26:22 +0000 Received: by mail-qa0-f54.google.com with SMTP id w8so5651230qac.27 for ; Sun, 27 Apr 2014 14:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Qx1zpcIWRe10yslvc34J9Pkp653TZjzacq7R7XJlP/o=; b=jO2WrhsfPVZUqkE8FC3MSQZUI1z1fk/27wu/p+q7rmmGsYoh68elFz/NBChMBaGfec oyCGBbP8cekQxk/QvLVD+pPL5KJFZGnJWElnvalK1ZdbpSGnCrqEZ2fHoSTOUU+XpbS0 H/jnWiJ1XaElOeDP4D0GQ5LSqoB6UgxbEv2PwlH0Jz5CvZ41nM2HPLlizo7Xk/qAw23T Qf+M1GVXTJKwE5Hy0CK9+rVeTvhZ32CKpH26T+ksQLGouplbrHlkzRubOYhtP6HTmByj 8mH4D/TwTnoRiSvfyxxQ902vqjp4Nyog8bYOegscdxRnjNd/BNTCokhvcJ8czMDULM80 zzZA== MIME-Version: 1.0 X-Received: by 10.140.96.68 with SMTP id j62mr27339967qge.5.1398633959663; Sun, 27 Apr 2014 14:25:59 -0700 (PDT) Received: by 10.140.91.68 with HTTP; Sun, 27 Apr 2014 14:25:59 -0700 (PDT) In-Reply-To: References: Date: Sun, 27 Apr 2014 23:25:59 +0200 Message-ID: Subject: Re: [PROPOSAL] KSM support for KVM hosts From: Laszlo Hornyak To: "dev@cloudstack.apache.org" Content-Type: multipart/alternative; boundary=001a113ab05656493f04f80cd8a0 X-Virus-Checked: Checked by ClamAV on apache.org --001a113ab05656493f04f80cd8a0 Content-Type: text/plain; charset=UTF-8 Hi David, The ksmd process takes quite some CPU time and keeps it at a constant level even when it is no longer able to find new pages to merge. The trick the dynamic configuration would do is to decide when is it safe to take some CPU-time and spend it on decreasing memory usage. Since in the agent (unlike in the linux kernel) we have access to information about this, I have reason to believe that it is possible to avoid conflict between household tasks and VM tasks in CPU. A logical next step would be to modify the scheduler/orchestration to take VM attributes in consideration and prefer similar VMs on the same host to better operate with ksm. Probably VMs could also gain from the same page merging, for example the CPU cache misses could be less frequent if their pages are merged. On Sun, Apr 27, 2014 at 5:08 PM, David Nalley wrote: > On Sun, Apr 27, 2014 at 3:48 AM, Laszlo Hornyak > wrote: > > Hi All, > > > > Currently Cloudstack does not manage the Linux Kernel SamePage Merger > [1]. > > A KSM support would allow the operator of the cloud to gain high VM > > densities in the cloudstack environment by merging the redundant memory > > pages. > > > > 1. Add new configuration setting for KSM feature > > - Ignore: Instructs agent to ignore KSM setting, this allows the cloud > > operator to manage KSM and good for backward compatibility > > - On: Instructs agents to turn on KSM without further dealing with it > > - Off: Instructs agents to turn off KSM > > - Dynamic: Instructs the agent to track KSM activity periodically, turn > on > > or off if needed and fine-tune runtime parameters based on its > performance. > > > > 2. Build decision logic into cloudstack agent: > > - Only enable KSM if running on Linux and KSM is built into kernel > > - Dynamic KSM configuration decision logic: > > - Configure and tune KSM based on number of VM's, their operating > > systems, the available and free processors and memory of the host. > > - The configuration and status of ksm needs to be checked periodically. > > > > In comparison to ksmtuned, the agent logic will build on information > > specific to cloud computing > > - build on expectations based on the OS/template of the VM > > - scale dynamically with the VM loads > > - activate on VM migrations/start/stop > > - respect CPU over-allocation, run ksm only when low CPU-load > > > > [1] https://www.kernel.org/doc/Documentation/vm/ksm.txt > > > > -- > > > > EOF > > > Hi Laszlo; > > KSM has always seemed to have a high CPU overhead when I've used it in > the real world. I am curious what you think the effect will be with > dynamically turning it on/off and particularly how it might impact > other VM operations as well as allocation decisions. > > --David > -- EOF --001a113ab05656493f04f80cd8a0--