Giter VIP home page Giter VIP logo

chef-tuned's Introduction

#Tuned Chef Cookbook

Build Status ![Gitter](https://badges.gitter.im/Join Chat.svg)

#Description

Installs tuned and enables/disables tuned profiles. For more information on tuned please see the Red Hat documentation on this daemon

#Usage

###Attribute overview

Define some attributes to be used by the 'tuned_profile' resource. Attributes have 3 levels

default['tuned']['profile']['myprofile']
  • used as the profile filename must match resource instance name
default['tuned']['profile']['myprofile']['cpu']
  • creates a heading in the profile init file [cpu]
default['tuned']['profile']['myprofile']['cpu']['governor'] = 'performance'
  • creates an key value entry in the profile file under the '[cpu]' heading

###Attribute example

default['tuned']['profile']['myprofile']['cpu']['governor'] = 'performance'
default['tuned']['profile']['myprofile']['cpu']['energy_perf_bias'] = 'performance'
default['tuned']['profile']['myprofile']['cpu']['min_perf_pct'] = '100'
default['tuned']['profile']['myprofile']['disk']['readahead'] = '4096'
default['tuned']['profile']['myprofile']['vm']['transparent_hugepage'] = 'never'
default['tuned']['profile']['myprofile']['vm']['transparent_hugepage.defrag'] = 'never'
default['tuned']['profile']['myprofile']['sysctl']['kernel.sched_wakeup_granularity_ns'] = '15000000'
default['tuned']['profile']['myprofile']['sysctl']['kernel.sched_min_granularity_ns'] = '10000000'
default['tuned']['profile']['myprofile']['sysctl']['vm.dirty_background_ratio'] = '10'
default['tuned']['profile']['myprofile']['sysctl']['vm.dirty_ratio'] = '30'
default['tuned']['profile']['myprofile']['main']['include'] = 'latency-performance'
default['tuned']['profile']['myprofile']['sysctl']['vm.swappiness'] = '30'
default['tuned']['profile']['myprofile']['sysfs']['/sys/kernel/mm/transparent_hugepage/enabled'] = 'never'
default['tuned']['profile']['myprofile']['sysfs']['/sys/kernel/mm/transparent_hugepage/defrag'] = 'never'

The above example attributes when combined with a resource call:

tuned_profile 'myprofile' do
 action [:create, :enable]
end

Will create a file

  • /usr/lib/tuned/myprofile/tuned.conf

With the following contents:

# Dynamically generated default tuned profile file, applied by Chef!
[main]
include=latency-performance
[cpu]
governor=performance
energy_perf_bias=performance
min_perf_pct=100
[disk]
readahead=4096
[sysctl]
kernel.sched_wakeup_granularity_ns=15000000
kernel.sched_min_granularity_ns=10000000
vm.dirty_background_ratio=10
vm.dirty_ratio=30
vm.swappiness=30
[sysfs]
/sys/kernel/mm/transparent_hugepage/enabled=never
/sys/kernel/mm/transparent_hugepage/defrag=never
[vm]
transparent_hugepage=never
transparent_hugepage.defrag=never

###include the default recipe

include tuned::default

Installs tuned if not already installed

###create and enable a profile

tuned_profile 'myprofile' do
 action [:create, :enable]
end

###enable a default system profile See Red Hat Documentation for availale defaults

tuned_profile 'balanced' do
 action [:enable]
end

###disable a profile (reverts to default)

tuned_profile 'myprofile' do
  action [:disable]
end

###default to tuned reccomended profile

tuned_profile 'myprofile' do
  action [:default]
end

#Contributing

  1. Fork it
  2. Create your feature branch + tests + Readme (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Requirements

Platform:

  • RHEL/CentOS (>= 7.0)

Cookbooks:

No dependencies defined

Attributes

No attributes defined

Recipes

  • tuned::default

Resources

tuned_profile

Actions

  • create: Default action.
  • default:
  • disable:
  • enable:

License and Maintainer

Maintainer:: Dave Meekin ([email protected])

License:: All rights reserved

chef-tuned's People

Contributors

davemeekin avatar

Watchers

 avatar

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.