Limit koschei-resolver memory usage

This limits real memory usage, virtual memory is not limited -
resolver won't use more than 2G of *real* memory (RAM), virtual memory
exceeding that limit will be swapped to disk.

This should leave more real memory for other services and disk cache,
while allowing koschei-resolver to keep older sacks in swap (loading
sack from swap should be faster than reloading it from repo files).
This commit is contained in:
Mikolaj Izdebski 2016-04-18 14:06:58 +00:00
parent bcc7b5cdf6
commit cdf6a5e1c7
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,2 @@
[Service]
MemoryLimit=2G

View file

@ -21,6 +21,17 @@
- koschei
- packages
- name: install systemd config files
copy: >
src=systemd-memory-limit.conf
dest=/etc/systemd/system/koschei-resolver.service.d/memory-limit.conf
notify:
- reload systemd
- restart koschei-resolver
tags:
- koschei
- config
- name: install config files
when: env == "staging"
template: >