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:
parent
c67da02ad7
commit
d0127d51bd
@ -26,6 +26,8 @@ memcached_port: 11211
|
|||||||
memcached_user: memcache
|
memcached_user: memcache
|
||||||
memcached_listen: "127.0.0.1"
|
memcached_listen: "127.0.0.1"
|
||||||
memcached_log: /var/log/memcached.log
|
memcached_log: /var/log/memcached.log
|
||||||
|
memcached_connections: 1024
|
||||||
|
memcached_threads: 4
|
||||||
|
|
||||||
memcached_apt_packages:
|
memcached_apt_packages:
|
||||||
- memcached
|
- memcached
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Drop memcached config
|
- name: Apply memcached config
|
||||||
template:
|
template:
|
||||||
src: "memcached.conf"
|
src: "memcached.conf"
|
||||||
dest: "/etc/memcached.conf"
|
dest: "/etc/memcached.conf"
|
||||||
@ -23,3 +23,16 @@
|
|||||||
notify: Restart memcached
|
notify: Restart memcached
|
||||||
tags:
|
tags:
|
||||||
- memcached-config
|
- 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
|
||||||
|
@ -6,3 +6,5 @@ logfile {{ memcached_log }}
|
|||||||
-p {{ memcached_port }}
|
-p {{ memcached_port }}
|
||||||
-u {{ memcached_user }}
|
-u {{ memcached_user }}
|
||||||
-l {{ memcached_listen }}
|
-l {{ memcached_listen }}
|
||||||
|
-c {{ memcached_connections }}
|
||||||
|
-t {{ memcached_threads }}
|
||||||
|
6
playbooks/roles/memcached_server/templates/memcached.j2
Normal file
6
playbooks/roles/memcached_server/templates/memcached.j2
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# {{ ansible_managed }}
|
||||||
|
# Any other value will disable memcached.
|
||||||
|
ENABLE_MEMCACHED=yes
|
||||||
|
|
||||||
|
ulimit -Hn {{ memcached_connections }}
|
||||||
|
ulimit -n {{ memcached_connections }}
|
Loading…
Reference in New Issue
Block a user