Puppet Class: pgpool::config::memorycache

Defined in:
manifests/config/memorycache.pp

Overview

Class: pgpool::config::memorycache

This class configures the memory caching options in pgpool.

Parameters

memory_cache_enabled

String. Enable the memory cache functionality. Defaults to off.

memqcache_method

String. The method of caching storage. Should be either shmem or memcached. Defaults to shmem.

memqcache_memcached_host

String. The memcache host to use. Defaults to localhost.

memqcache_memcached_port

Integer. The memcache port to use. Defaults to 11211.

memqcache_total_size

Integer. The total size of the memory cache. Defaults to 67108864.

memqcache_max_num_cache

Integer. The total number of items to cache. Defaults to 1000000.

memqcache_expire

Intger. The expire time in seconds. Defaults to 0.

memqcache_auto_cache_invalidation

String. Should the cache be invalidated automatically. Defaults to on.

memqcache_maxcache

Integer. The maxium size of a SELECT result to cache. Defaults to 409600.

memqcache_cache_block_size

Intger. If cache storage is shared memory, pgpool uses the memory divided by memqcache_cache_block_size. SELECT result is packed into the block. However because the SELECT result cannot be placed in several blocks, it cannot be cached if it is larger than memqcache_cache_block_size. memqcache_cache_block_size must be greater or equal to 512. Defaults to 1048576.

memqcache_oiddir

String. The full path to the directory where the oids of tables used by SELECTs are stored. Defaults to /var/log/pgpool/oiddir.

white_memqcache_table_list

String. Comma separated lsit of tables names who select results are to be cached. Defaults to ''.

black_memqcache_table_list

String. Comma separated lsit of tables names who select results are NOT to be cached. Defaults to ''.

Variables

N/A

Examples

N/A

Authors

Alex Schultz <aschultz@next-development.com>

Parameters:

  • memory_cache_enabled (Any) (defaults to: 'off')
  • memqcache_method (Any) (defaults to: 'shmem')
  • memqcache_memcached_host (Any) (defaults to: 'localhost')
  • memqcache_memcached_port (Any) (defaults to: 11211)
  • memqcache_total_size (Any) (defaults to: 67108864)
  • memqcache_max_num_cache (Any) (defaults to: 1000000)
  • memqcache_expire (Any) (defaults to: 0)
  • memqcache_auto_cache_invalidation (Any) (defaults to: 'on')
  • memqcache_maxcache (Any) (defaults to: 409600)
  • memqcache_cache_block_size (Any) (defaults to: 1048576)
  • memqcache_oiddir (Any) (defaults to: '/var/log/pgpool/oiddir')
  • white_memqcache_table_list (Any) (defaults to: '')
  • black_memqcache_table_list (Any) (defaults to: '')


79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'manifests/config/memorycache.pp', line 79

class pgpool::config::memorycache (
  $memory_cache_enabled              = 'off',
  $memqcache_method                  = 'shmem',
  $memqcache_memcached_host          = 'localhost',
  $memqcache_memcached_port          = 11211,
  $memqcache_total_size              = 67108864,
  $memqcache_max_num_cache           = 1000000,
  $memqcache_expire                  = 0,
  $memqcache_auto_cache_invalidation = 'on',
  $memqcache_maxcache                = 409600,
  $memqcache_cache_block_size        = 1048576,
  $memqcache_oiddir                  = '/var/log/pgpool/oiddir',
  $white_memqcache_table_list        = '',
  $black_memqcache_table_list        = '',
) {

  $memorycache_config = {
    'memory_cache_enabled'              => { value => $memory_cache_enabled },
    'memqcache_method'                  => { value => $memqcache_method },
    'memqcache_memcached_host'          => { value => $memqcache_memcached_host },
    'memqcache_memcached_port'          => { value => $memqcache_memcached_port },
    'memqcache_total_size'              => { value => $memqcache_total_size },
    'memqcache_max_num_cache'           => { value => $memqcache_max_num_cache },
    'memqcache_expire'                  => { value => $memqcache_expire },
    'memqcache_auto_cache_invalidation' => { value => $memqcache_auto_cache_invalidation },
    'memqcache_maxcache'                => { value => $memqcache_maxcache },
    'memqcache_cache_block_size'        => { value => $memqcache_cache_block_size },
    'memqcache_oiddir'                  => { value => $memqcache_oiddir },
    'white_memqcache_table_list'        => { value => $white_memqcache_table_list },
    'black_memqcache_table_list'        => { value => $black_memqcache_table_list },
  }

  $memorycache_defaults = {
    ensure => present
  }

  create_resources(pgpool::config::val, $memorycache_config, $memorycache_defaults)
}