1467f69191
Add cgroup memory limits to the jenkins_slave module. Nodes including jenkins_slave::cgroups will have the jenkins user's processes limited to use only 90% of the nodes available memory. There are two exceptions to this. The jenkins process run by the jenkins user will not have its memory capped. Also there is a soft memory limit of total physical memory * 0.75. If there is memory contention the jenkins user processes may get only 75% of available memory. Change-Id: If4a6439b536df4003d74fd1a93686c1c2401ae20
38 lines
776 B
Puppet
38 lines
776 B
Puppet
class jenkins_slave::cgroups {
|
|
|
|
package { 'cgroup-bin':
|
|
ensure => present
|
|
}
|
|
|
|
file { '/etc/cgconfig.conf':
|
|
ensure => present,
|
|
replace => true,
|
|
owner => root,
|
|
mode => 0644,
|
|
content => template('jenkins_slave/cgconfig.erb')
|
|
}
|
|
|
|
file { '/etc/cgrules.conf':
|
|
ensure => present,
|
|
replace => true,
|
|
owner => root,
|
|
mode => 0644,
|
|
source => 'puppet:///modules/jenkins_slave/cgroups/cgrules.conf'
|
|
}
|
|
|
|
service { 'cgconfig':
|
|
enable => true,
|
|
ensure => running,
|
|
require => Package['cgroup-bin'],
|
|
subscribe => File['/etc/cgconfig.conf']
|
|
}
|
|
|
|
service { 'cgred':
|
|
enable => true,
|
|
ensure => running,
|
|
require => Package['cgroup-bin'],
|
|
subscribe => File['/etc/cgrules.conf']
|
|
}
|
|
|
|
}
|