Skip to content
Snippets Groups Projects
Commit acb63a57 authored by Matthew Mosesohn's avatar Matthew Mosesohn Committed by GitHub
Browse files

Only limit etcd memory on small hosts (#1860)

Also disable oom killer on etcd
parent 5b08277c
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,8 @@ etcd_election_timeout: "5000" ...@@ -17,7 +17,8 @@ etcd_election_timeout: "5000"
etcd_metrics: "basic" etcd_metrics: "basic"
# Limits # Limits
etcd_memory_limit: 512M # Limit memory only if <4GB memory on host. 0=unlimited
etcd_memory_limit: "{% if ansible_memtotal_mb < 4096 %}512M{% else %}0{% endif %}"
# Uncomment to set CPU share for etcd # Uncomment to set CPU share for etcd
# etcd_cpu_limit: 300m # etcd_cpu_limit: 300m
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
{% if etcd_memory_limit is defined %} {% if etcd_memory_limit is defined %}
--memory={{ etcd_memory_limit|regex_replace('Mi', 'M') }} \ --memory={{ etcd_memory_limit|regex_replace('Mi', 'M') }} \
{% endif %} {% endif %}
--oom-kill-disable \
{% if etcd_cpu_limit is defined %} {% if etcd_cpu_limit is defined %}
--cpu-shares={{ etcd_cpu_limit|regex_replace('m', '') }} \ --cpu-shares={{ etcd_cpu_limit|regex_replace('m', '') }} \
{% endif %} {% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment