Puppet Class: mediawiki::cgroup

Defined in:
modules/mediawiki/manifests/cgroup.pp

Overview

Class: mediawiki::cgroup

MediaWiki uses cgroups (abbreviated from control groups) to limit the resource usage of commands invoked in a subprocess via wfShellExec(), like texvc and lilypond. The cgroup is specified by via $wgShellCgroup.

See also: <www.mediawiki.org/wiki/Manual:$wgShellCgroup>



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'modules/mediawiki/manifests/cgroup.pp', line 9

class mediawiki::cgroup {

    require_package('cgroup-bin')

    # The cgroup-mediawiki-clean script is used as the release_agent
    # script for the cgroup. When the last task in the cgroup exits,
    # the kernel will run the script.

    file { '/usr/local/bin/cgroup-mediawiki-clean':
        source => 'puppet:///modules/mediawiki/cgroup/cgroup-mediawiki-clean',
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
    }

    base::service_unit { 'mw-cgroup':
        ensure  => present,
        systemd => systemd_template('mw-cgroup'),
        refresh => false,
    }

    grub::bootparam { 'cgroup_enable':
        value => 'memory',
    }

    grub::bootparam { 'swapaccount':
        value => '1',
    }
}