Add maxmemory-policy configurable

This patch makes the redis maxmemory-policy configurable,
and sets default value to allkeys-lru instead of
volatile-lru. The setting allkeys-lru helps to remove keys
without an exact expire setting of a keypair.

Change-Id: I5edaa6a5fbdc99631838478460b36795539292cf
This commit is contained in:
Marton Kiss 2015-04-12 20:13:49 +02:00
parent e872e6d5e2
commit 2095f20b83
4 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,7 @@ class redis(
$redis_bind = '127.0.0.1',
$redis_password = '',
$redis_max_memory = '1gb',
$redis_max_memory_policy = 'allkeys-lru',
$version = '2.2.12',
) {

View File

@ -218,6 +218,7 @@ maxmemory <%= redis_max_memory %>
# The default is:
#
# maxmemory-policy volatile-lru
maxmemory-policy <%= @redis_max_memory_policy %>
# LRU and minimal TTL algorithms are not precise algorithms but approximated
# algorithms (in order to save memory), so you can select as well the sample

View File

@ -254,6 +254,7 @@ maxmemory <%= redis_max_memory %>
# The default is:
#
# maxmemory-policy volatile-lru
maxmemory-policy <%= @redis_max_memory_policy %>
# LRU and minimal TTL algorithms are not precise algorithms but approximated
# algorithms (in order to save memory), so you can select as well the sample

View File

@ -338,6 +338,7 @@ maxmemory <%= redis_max_memory %>
# The default is:
#
# maxmemory-policy volatile-lru
maxmemory-policy <%= @redis_max_memory_policy %>
# LRU and minimal TTL algorithms are not precise algorithms but approximated
# algorithms (in order to save memory), so you can select as well the sample