compass-adapters/chef/cookbooks/cpu
Sam Su e52a7244a7 add haproxy
Change-Id: I487200a373b4eed7ff36f00b1e0269b008cd19bd
2014-03-21 11:27:10 -07:00
..
attributes add haproxy 2014-03-21 11:27:10 -07:00
libraries add haproxy 2014-03-21 11:27:10 -07:00
providers add haproxy 2014-03-21 11:27:10 -07:00
recipes add haproxy 2014-03-21 11:27:10 -07:00
resources add haproxy 2014-03-21 11:27:10 -07:00
.gitignore add haproxy 2014-03-21 11:27:10 -07:00
README.md add haproxy 2014-03-21 11:27:10 -07:00
metadata.json add haproxy 2014-03-21 11:27:10 -07:00
metadata.rb add haproxy 2014-03-21 11:27:10 -07:00

README.md

DESCRIPTION

Chef cookbook to manage CPU related actions on linux.

REQUIREMENTS

Linux 2.6+ tested on Ubuntu.

Attributes

  • node['cpu']['governor'] - governator for to set for the node

Recipes

governor

Set the governator for the node from attributes

affinity

Install software to set cpu affinity of a process.

Resources and Providers

affinity

Set the affinity for a process.

Actions

  • set - Set affinity

Attribute Parameters

  • cpu : Cpu(s) affinity - required
  • pid : Pid or PidFile - name

Examples

cpu_affinity 1234 do
  cpu 0
end
# Set affinity to processor 0,1,2 for process nginx
cpu-affinity "set affinity for nginx" do
  pid "/var/run/nginx.pid"
  cpu "0-2"
end

nice

Set the priority for a process.

Actions

  • set - Set priority

Attribute Parameters

  • pid : Pid or PidFile - name
  • priority : priority for process

Examples

cpu_nice 1234 do
  priority 12
end
cpu_nice "set affinity for nginx" do
  pid "/var/run/nginx.pid"
  priority 19
end

USAGE

in a recipe:

node.set["node"]["cpu"]["governor"] = "performance" include_recipe "cpu::governor"