Git Product home page Git Product logo

puppet-ksm's Introduction

Puppet ksm Module

Build Status

Table of Contents

  1. Overview
  2. Description
  3. Words of Caution
  4. Usage
  5. Limitations
  6. Support
  7. See Also

Overview

Manages Linux Kernel Samepage Merging (KSM)

Description

This is a puppet module for configuration of the ksm and ksmtuned services that in turn manage Linux's Kernel Samepage Merging (KSM) functionality. The KSM subsystem has broad applicability but is typically used on hosts acting as hypervisor for KVM virtual machines.

The typical mode of operation is that the ksmtuned service starts and stops the ksm service based configurable heuristics. At present, this is the only configuration supported by this module.

Words of Caution

Documentation on the configuration of ksmtuned is sparse. There is section in RHEL6 Virtualization Administration Guide but it doesn't provide much help and at least the description of pages_to_scan is incorrect.

There is a much more useful explanation in the RHEL6 Solutions site but it is only accessible to customer paying for RHEL support.

Be advised that:

  • KSM consumes both CPU time (aka electricity) and memory bandwidth.
  • Under at least Linux 2.6.32/RHEL6 KSM merged pages that have been swapped out are unshared when swapped back in. I suspect I've seen this exacerbate "swap hell" caused by not adjusting vm.swappiness from the default on large memory hosts.

Usage

Simple

The defaults are probably acceptable for most use cases.

include ksm

or

class { 'ksm': }

Advanced

This example:

  • Disables the default 50% of memory shared page limit (KSM_MAX_KERNEL_PAGES)
  • Changes the interval that ksmtuned wakes up at from 60s -> 15s
  • Changes the default 'free' memory threshold from 20% to 25%
  • Changes the default number of pages scanned per KSM cycle (typically 10msec) from 1250 -> 256
class { 'ksm':
  ksm_config      => {
    'KSM_MAX_KERNEL_PAGES' => 0,
  },
  ksmtuned_config => {
    'KSM_MONITOR_INTERVAL' => 15,
    'KSM_THRES_COEF'       => 25,
    'KSM_NPAGES_MAX'       => 256
  },
}

Files

The ksmtuned debugging log is enabled at the path /var/log/ksmtuned with logrotate support.

ksm

# defaults
class { 'ksm':
  ksm_config      => {},
  ksmtuned_config => {},
}
  • ksm_config

    Hash

    Options to be set in /etc/sysconfig/ksm

    Valid Keys are:

    • KSM_MAX_KERNEL_PAGES

    defaults to: {}

  • ksmtuned_config

    Hash

    Options to be set in /etc/ksmtuned.conf

    Valid Keys are:

    • KSM_MONITOR_INTERVAL
    • KSM_SLEEP_MSEC
    • KSM_NPAGES_BOOST
    • KSM_NPAGES_DECAY
    • KSM_NPAGES_MIN
    • KSM_NPAGES_MAX
    • KSM_THRES_COEF
    • KSM_THRES_CONST

    defaults to: {}

Limitations

At present, only support for $::osfamily == 'RedHat' has been implemented.

Tested Platforms

  • el6.x

Support

Please log tickets and issues at github

See Also

puppet-ksm's People

Contributors

jhoblitt avatar

Stargazers

duritong avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

kilianw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.