Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

cpu (18) Versions 0.2.0

Manage CPU Governor on linux

Policyfile
Berkshelf
Knife
cookbook 'cpu', '= 0.2.0', :supermarket
cookbook 'cpu', '= 0.2.0'
knife supermarket install cpu
knife supermarket download cpu
README
Dependencies
Quality 50%

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"

Collaborator Number Metric
            

0.2.0 passed this metric

Collaborator Number Metric
            

0.2.0 passed this metric

Foodcritic Metric
            

0.2.0 failed this metric

FC017: LWRP does not notify when updated: /tmp/74ade164c6781122487480ad/cpu/providers/affinity.rb:21
FC017: LWRP does not notify when updated: /tmp/74ade164c6781122487480ad/cpu/providers/nice.rb:21
FC059: LWRP provider does not declare use_inline_resources: /tmp/74ade164c6781122487480ad/cpu/providers/affinity.rb:1
FC059: LWRP provider does not declare use_inline_resources: /tmp/74ade164c6781122487480ad/cpu/providers/nice.rb:1
FC064: Ensure issues_url is set in metadata: /tmp/74ade164c6781122487480ad/cpu/metadata.rb:1
FC065: Ensure source_url is set in metadata: /tmp/74ade164c6781122487480ad/cpu/metadata.rb:1
Run with Foodcritic Version 8.0.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

Foodcritic Metric
            

0.2.0 failed this metric

FC017: LWRP does not notify when updated: /tmp/ae1fc8e9e02977851b3bfaf8/cpu/providers/affinity.rb:21
FC017: LWRP does not notify when updated: /tmp/ae1fc8e9e02977851b3bfaf8/cpu/providers/nice.rb:21
FC059: LWRP provider does not declare use_inline_resources: /tmp/ae1fc8e9e02977851b3bfaf8/cpu/providers/affinity.rb:1
FC059: LWRP provider does not declare use_inline_resources: /tmp/ae1fc8e9e02977851b3bfaf8/cpu/providers/nice.rb:1
FC064: Ensure issues_url is set in metadata: /tmp/ae1fc8e9e02977851b3bfaf8/cpu/metadata.rb:1
FC065: Ensure source_url is set in metadata: /tmp/ae1fc8e9e02977851b3bfaf8/cpu/metadata.rb:1
Run with Foodcritic Version 8.0.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any