diff --git a/memcached/map.jinja b/memcached/map.jinja index 985eccc..ec86d5e 100644 --- a/memcached/map.jinja +++ b/memcached/map.jinja @@ -11,6 +11,7 @@ 'lock_paged_memory': False, 'error_on_mem_full': False, 'max_core_file_limit': False, + 'slab_size_limit': 1m, } } %} {% set memcached = salt['grains.filter_by']({ diff --git a/memcached/templates/conf.d/memcached b/memcached/templates/conf.d/memcached index 185b49e..abd434c 100644 --- a/memcached/templates/conf.d/memcached +++ b/memcached/templates/conf.d/memcached @@ -34,3 +34,7 @@ PIDBASE="/var/run/memcached/memcached" #Other Options MISC_OPTS="" + +{% if get_config_item('slab_size_limit') != '1m' %} +MISC_OPTS="$MISC_OPTS -I {{ get_config_item('slab_size_limit') }}" +{% endif %} diff --git a/memcached/templates/memcached.conf b/memcached/templates/memcached.conf index 15416d2..6450497 100644 --- a/memcached/templates/memcached.conf +++ b/memcached/templates/memcached.conf @@ -47,3 +47,8 @@ logfile {{ get_config_item('log_file') }} # Maximize core file limit # -r {{ '-r' if get_config_item('max_core_file_limit') == 'True' else '' }} + +{% if get_config_item('slab_size_limit') != '1m' %} +# Override the size of each slab page in bytes. In mundane words, it adjusts the maximum item size that memcached will accept. +-I {{ get_config_item('slab_size_limit') }} +{% endif %} diff --git a/memcached/templates/sysconfig/memcached b/memcached/templates/sysconfig/memcached index 3e06707..6066b0b 100644 --- a/memcached/templates/sysconfig/memcached +++ b/memcached/templates/sysconfig/memcached @@ -14,10 +14,14 @@ OPTIONS="$OPTIONS -k" OPTIONS="$OPTIONS -M" {% endif %} -{% if get_config_item('max_core_file_"limit') == 'True' %} +{% if get_config_item('max_core_file_limit') == 'True' %} OPTIONS="$OPTIONS -r" {% endif %} +{% if get_config_item('slab_size_limit') != '1m' %} +OPTIONS="$OPTIONS -I {{ get_config_item('slab_size_limit') }}" +{% endif %} + {% if get_config_item('verbose_level') == '1' %} OPTIONS="$OPTIONS -v >> {{ get_config_item('log_file') }} 2>&1" {% elif get_config_item('verbose_level') == '2' %} diff --git a/pillar.example b/pillar.example index f9a9b95..9027282 100644 --- a/pillar.example +++ b/pillar.example @@ -9,3 +9,4 @@ memcached: lock_paged_memory: False error_on_mem_full: False max_core_file_limit: False + slab_size_limit: 1m