Puppet Function: pupmod::reserved_code_cache

Defined in:
functions/reserved_code_cache.pp
Function type:
Puppet Language

Overview

pupmod::reserved_code_cache()Integer

Provides a reasonable calculation for the reserved code cache value for JRuby for a system

Returns:

  • (Integer)

    The maximum number of JRuby instances that should be active on the “puppetserver“



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'functions/reserved_code_cache.pp', line 7

function pupmod::reserved_code_cache {
  $mem_mb = Integer(Numeric(fact('memorysize_mb')))

  if $mem_mb < 8192 {
    $reserved_code_cache = 0
  } elsif $mem_mb < 16384 {
    $reserved_code_cache = 512
  } elsif $mem_mb < 32768 {
    $reserved_code_cache = 1024
  } else {
    $reserved_code_cache = 2048
  }

  $reserved_code_cache
}