Allow adjusting the default slab size ie -I option

This commit is contained in:
Victor Moura 2016-08-08 18:46:59 -03:00
parent 10e3797008
commit 0095b5b39d
5 changed files with 16 additions and 1 deletions

View File

@ -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']({

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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' %}

View File

@ -9,3 +9,4 @@ memcached:
lock_paged_memory: False
error_on_mem_full: False
max_core_file_limit: False
slab_size_limit: 1m