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. Related-To: https://review.openstack.org/#/c/317030/ Change-Id: Ib9a3a5fdf567e6024819ebcfd574a5d1d15e5e23 Closes-Bug: #1582288
This commit is contained in:
parent
434bfacb83
commit
a9185101a3
|
@ -28,6 +28,7 @@ memcached_listen: "127.0.0.1"
|
|||
memcached_log: /var/log/memcached.log
|
||||
memcached_connections: 1024
|
||||
memcached_threads: 4
|
||||
memcached_file_limits: "{{ memcached_connections | int + 1024 }}"
|
||||
|
||||
memcached_apt_packages:
|
||||
- memcached
|
||||
|
|
|
@ -36,3 +36,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"
|
||||
|
|
|
@ -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.
|
Loading…
Reference in New Issue