Commit 9ea38252 authored by godog's avatar godog

Revert "base: limit mtail.service memory"

Turns out MemoryLimit= includes swap memory, not ideal.

This reverts commit 0ed7d159.
parent 3ad83ad6
Pipeline #3304 failed with stage
in 180 minutes and 2 seconds
...@@ -8,9 +8,6 @@ Type=simple ...@@ -8,9 +8,6 @@ Type=simple
ExecStart=/usr/bin/mtail -progs /etc/mtail -logtostderr -port 3903 -logfds 3 ExecStart=/usr/bin/mtail -progs /etc/mtail -logtostderr -port 3903 -logfds 3
Restart=on-failure Restart=on-failure
User=mtail User=mtail
# mtail can leak memory (https://github.com/google/mtail/issues/61) although
# limiting the cgroup seems to make Go happy
MemoryLimit=512M
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
  • A quanto pare funziona creando una cartella mtail.service.d in /etc/systemd/service/ e schiaffandoci dentro un limits.conf. Pero' attenzione perche' i parametri per cgroups sono specificati qui: https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html

    Nota che MemoryLimit non c'e'. C'e' MemoryMax che pero' invoca l'oom killer se superi la soglia. E c'e' MemoryHigh che invece

    Memory usage may go above the limit if unavoidable, but the processes are heavily slowed down and memory is taken away aggressively in such cases. This is the main mechanism to control memory usage of a unit.

    Ho fatto sta cosa a manina su latitanza, e mi sa che funziona perche' nel dmesg ho visto dei messaggi su oom invocato verso mtail (ho provato con max prima). Resta da capire come vedere i limiti in azione su una unit per verificare che siano in uso, senza evocare l'oom killer :-)

    Per ora ho lasciato la cosa fatta a manina su latitanza, con MemoryHigh = 280M che dovrebbe essere un settaggio piuttosto conservatore. Vediamo come va? Nella peggiore delle ipotesi basta rimuovere la cartella mtail.service.d e rilanciare il servizio / reloadare systemd.

    Keep me posted!

    Edited by subvertao
  • Direi che funzia:

    root@latitanza:/etc/systemd/system# systemctl status mtail.service
    * mtail.service - MTail
       Loaded: loaded (/etc/systemd/system/mtail.service; enabled; vendor preset: enabled)
      Drop-In: /etc/systemd/system/mtail.service.d
               `-limits.conf
       Active: active (running) since Thu 2019-06-06 22:18:47 UTC; 14min ago
     Main PID: 15356 (mtail)
        Tasks: 21 (limit: 4915)
       Memory: 90.0M (high: 280.0M)
          CPU: 1min 3.140s
       CGroup: /system.slice/mtail.service
               `-15356 /usr/bin/mtail -progs /etc/mtail -logtostderr -port 3903 -logfds 3
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