Configurable memcached connections limit & threads

Increasing memcached_connections may require ulimit to be raised so
that will be done if necessary.

Increasing memcached_threads is not strongly recommended but is
available if needed.

Change-Id: I4b58d59f647e6f843fc33561dea75be67c0f78c4
Closes-Bug: #1438498
This commit is contained in:
Steve Lewis 2015-06-22 17:49:51 -07:00
parent c67da02ad7
commit d0127d51bd
4 changed files with 24 additions and 1 deletions

View File

@ -26,6 +26,8 @@ memcached_port: 11211
memcached_user: memcache
memcached_listen: "127.0.0.1"
memcached_log: /var/log/memcached.log
memcached_connections: 1024
memcached_threads: 4
memcached_apt_packages:
- memcached

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Drop memcached config
- name: Apply memcached config
template:
src: "memcached.conf"
dest: "/etc/memcached.conf"
@ -23,3 +23,16 @@
notify: Restart memcached
tags:
- memcached-config
- name: Apply resource limits
template:
src: "memcached.j2"
dest: "/etc/default/memcached"
owner: "root"
group: "root"
mode: "0644"
when: >
memcached_connections > 1024
notify: Restart memcached
tags:
- memcached-config

View File

@ -6,3 +6,5 @@ logfile {{ memcached_log }}
-p {{ memcached_port }}
-u {{ memcached_user }}
-l {{ memcached_listen }}
-c {{ memcached_connections }}
-t {{ memcached_threads }}

View File

@ -0,0 +1,6 @@
# {{ ansible_managed }}
# Any other value will disable memcached.
ENABLE_MEMCACHED=yes
ulimit -Hn {{ memcached_connections }}
ulimit -n {{ memcached_connections }}