Merge pull request #15 from pentagramacs/master

Allow to set the default slab item size
This commit is contained in:
Forrest 2016-08-08 15:19:31 -07:00 committed by GitHub
commit 65acc8d7b7
5 changed files with 16 additions and 1 deletions

View File

@ -11,6 +11,7 @@
'lock_paged_memory': False, 'lock_paged_memory': False,
'error_on_mem_full': False, 'error_on_mem_full': False,
'max_core_file_limit': False, 'max_core_file_limit': False,
'slab_size_limit': '1m',
} }
} %} } %}
{% set memcached = salt['grains.filter_by']({ {% set memcached = salt['grains.filter_by']({

View File

@ -34,3 +34,7 @@ PIDBASE="/var/run/memcached/memcached"
#Other Options #Other Options
MISC_OPTS="" 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 # Maximize core file limit
# -r # -r
{{ '-r' if get_config_item('max_core_file_limit') == 'True' else '' }} {{ '-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" OPTIONS="$OPTIONS -M"
{% endif %} {% endif %}
{% if get_config_item('max_core_file_"limit') == 'True' %} {% if get_config_item('max_core_file_limit') == 'True' %}
OPTIONS="$OPTIONS -r" OPTIONS="$OPTIONS -r"
{% endif %} {% 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' %} {% if get_config_item('verbose_level') == '1' %}
OPTIONS="$OPTIONS -v >> {{ get_config_item('log_file') }} 2>&1" OPTIONS="$OPTIONS -v >> {{ get_config_item('log_file') }} 2>&1"
{% elif get_config_item('verbose_level') == '2' %} {% elif get_config_item('verbose_level') == '2' %}

View File

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