From 0e453c1bd9cb060b53699240f0beb856a50c6489 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Sat, 24 Mar 2018 23:00:04 +0800 Subject: [PATCH] Use higher max memory for items in memcached The default max memory is 64MB, which is too small for production environment. Change-Id: I72d87cd29762fe49ae4f711f092df655cea954a9 Closes-Bug: #1758286 --- ansible/roles/memcached/defaults/main.yml | 3 +++ ansible/roles/memcached/templates/memcached.json.j2 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ansible/roles/memcached/defaults/main.yml b/ansible/roles/memcached/defaults/main.yml index 2e02b716d9..d21a55b615 100644 --- a/ansible/roles/memcached/defaults/main.yml +++ b/ansible/roles/memcached/defaults/main.yml @@ -23,3 +23,6 @@ memcached_image_full: "{{ memcached_image }}:{{ memcached_tag }}" # Memcached options #################### memcached_connection_limit: "5000" +# NOTE(jeffrey4l): max memory to use for items in megabytes. default is 64MB, +# which is too small for production environment. +memcached_max_memory: "256" diff --git a/ansible/roles/memcached/templates/memcached.json.j2 b/ansible/roles/memcached/templates/memcached.json.j2 index 9f338cd19a..981792762a 100644 --- a/ansible/roles/memcached/templates/memcached.json.j2 +++ b/ansible/roles/memcached/templates/memcached.json.j2 @@ -1,4 +1,4 @@ { - "command": "/usr/bin/memcached -v -l {{ api_interface_address }} -p {{ memcached_port }} -c {{ memcached_connection_limit }} -U 0", + "command": "/usr/bin/memcached -v -l {{ api_interface_address }} -p {{ memcached_port }} -c {{ memcached_connection_limit }} -U 0 -m {{ memcached_max_memory }}", "config_files": [] }