Configure nofile OS limit for memcached server role
This fix adds a new override `memcached_connections` which is automatically calculated from the number of memcached connection limit plus additional 1k to configure the OS nofile limit. Without proper nofile limit configuration, memcached will crash in order to support higher parallel connection TCP/Memcache counts. Closes-Bug: #1582288 Change-Id: I558ba329b7247cdfcf660e392c3ae0c4a0d65a53
This commit is contained in:
parent
17e0ea141e
commit
5c2d8c55ec
|
@ -35,6 +35,7 @@ memcached_listen: "127.0.0.1"
|
|||
memcached_log: /var/log/memcached/memcached.log
|
||||
memcached_connections: 1024
|
||||
memcached_threads: 4
|
||||
memcached_file_limits: "{{ memcached_connections | int + 1024 }}"
|
||||
|
||||
memcached_apt_packages:
|
||||
- memcached
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
features:
|
||||
- The openstack-ansible-memcached_server role includes
|
||||
a new override,`memcached_connections` which is
|
||||
automatically calculated from the number of memcached
|
||||
connection limit plus additional 1k to configure
|
||||
the OS nofile limit. Without proper nofile limit
|
||||
configuration, memcached will crash in order to support
|
||||
higher parallel connection TCP/Memcache counts.
|
|
@ -41,3 +41,19 @@
|
|||
notify: Restart memcached
|
||||
tags:
|
||||
- memcached-config
|
||||
|
||||
- name: Configure soft file limits
|
||||
lineinfile:
|
||||
dest: "/etc/security/limits.conf"
|
||||
regexp: "^memcache.*soft.*nofile.*"
|
||||
state: "present"
|
||||
line: "memcache\tsoft\tnofile\t\t{{ memcached_file_limits }}"
|
||||
insertbefore: "^# End of file"
|
||||
|
||||
- name: Configure hard file limits
|
||||
lineinfile:
|
||||
dest: "/etc/security/limits.conf"
|
||||
regexp: "^memcache.*hard.*nofile.*"
|
||||
state: "present"
|
||||
line: "memcache\thard\tnofile\t\t{{ memcached_file_limits }}"
|
||||
insertbefore: "^# End of file"
|
||||
|
|
Loading…
Reference in New Issue