The problem is about the systemd services. I know we can limit the Memory Usage or Cpu usage of services but my question is that is there a way to restart service when it reaches to its Memory high limit(or cpu)? Because i want to know that if the service is out of memory(leak) it has to restart again. I used these in unit file for limiting memory and cpu of service:

  • Conceptually l think the limits in a systemd service unit are designed to protect all the other services on your system from a run-away process and not the process itself - I think such a runaway service is expected to either gracefully recover from a MemoryHigh or to die when the hard limit MemoryMax is reached (and then systemd can restart it for you with Restart=on-failure ) see freedesktop.org/software/systemd/man/… and the references therein - I think you need external monitoring on occurrences of MemoryHigh events – Bob Jan 7 '20 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.