Puppet Class: redis::administration

Defined in:
manifests/administration.pp

Overview

Allows various adminstrative settings for Redis As documented in the FAQ and redis.io/topics/admin

Examples:

include redis::administration
class {'redis::administration':
  disable_thp => false,
}

Parameters:

  • enable_overcommit_memory (Boolean) (defaults to: true)

    Enable the overcommit memory setting (Defaults to true)

  • disable_thp (Boolean) (defaults to: true)

    Disable Transparent Huge Pages (Defaults to true)

  • somaxconn (String) (defaults to: '65535')

    Set somaxconn value (Defaults to ‘65535’)

Author:

    • Peter Souter



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'manifests/administration.pp', line 18

class redis::administration(
  $enable_overcommit_memory = true,
  $disable_thp              = true,
  $somaxconn                = '65535',
) {

  if $enable_overcommit_memory {
    sysctl { 'vm.overcommit_memory':
      ensure => 'present',
      value  => '1',
    }
  }

  if $disable_thp {
    exec { 'Disable Hugepages':
      command => 'echo never > /sys/kernel/mm/transparent_hugepage/enabled',
      path    => ['/sbin', '/usr/sbin', '/bin', '/usr/bin'],
      onlyif  => 'test -f /sys/kernel/mm/transparent_hugepage/enabled',
      unless  => 'cat /sys/kernel/mm/transparent_hugepage/enabled | grep "\[never\]"',
    }
  }

  if $somaxconn {
    sysctl { 'net.core.somaxconn':
      ensure => 'present',
      value  => $somaxconn,
    }
  }

}