Commit 4d827c04 authored by ale's avatar ale

Set memory limits using MemoryMax

This works with cgroups v1 which is what we're currently using.

Fixes issue #77.
parent c4c309ba
Pipeline #6757 passed with stage
in 5 minutes and 28 seconds
......@@ -17,7 +17,8 @@ SyslogIdentifier={{ item.service }}-{{ item.container.name }}
{% if item.container.resources is defined %}
{% if item.container.resources.ram is defined %}
MemoryHigh={{ item.container.resources.ram }}
MemoryMax={{ item.container.resources.ram }}
ExecStartPost=+/bin/sh -c "echo 0 > /sys/fs/cgroup/memory/system.slice/%n/memory.swappiness"
{% endif %}
{% if item.container.resources.cpu is defined %}
CPUQuota={{ 100 * item.container.resources.cpu }}%
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment