[systemd-devel] Systemd, cgroups and short-lived processes

Boris Dolgov boris at dolgov.name
Wed May 3 15:02:48 UTC 2017


Hello!

I am using systemd and repeatedly need to do the following:
- Start a process with memory limit and cpu affinity;
- Be notified when it and all its children are finished (typically in
0.01-1 second);
- Get cpu and memory usage statistics.

Cgroups look perfect for me, but what is the best way of managing them?

As far as I understand, ControlGroupInterface article advises to
create a transient scope unit for each process I run, but I need to
preserve cpu accounting information, so scope units will not work.
Alternatively, I could create service units, but I am concerned with
performance issues and would like to create processes by myself.

Are any lower-level APIs available and advised to use?
For example, I'd be happy to create a slice using systemd, create its
subtrees manually and manage them myself, but the aforementioned
article does not recommend it.

Thanks,
Boris.


More information about the systemd-devel mailing list