[systemd-devel] restricting resource of a process within a service

Colin Guthrie colin at mageia.org
Wed Oct 18 08:49:16 UTC 2017


Armen Baloyan wrote on 18/10/17 02:21:
> Hi,
> 
> I need to restrict CPU usage for a process that runs in a service. The
> service has over 10 processes running but I need to put restrictions
> only on 1 of those processes.
> Is it possible to move this process to a separate cgroup or it cannot be
> removed its service's cgroup?

I don't think this is supported.

Depending on how your "master" process works and communicates with it's
10 processes, you may want to consider splitting your service out into
separate systemd units. They can all be dependant on each other or,
depending on your IPC mechanisms, you can use socket or bus activation.
This then lets you have separate systemd units for each and apply
whatever accounting and restrictions you may wish on each.

HTHs

Col


-- 

Colin Guthrie
colin(at)mageia.org
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list