<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr"><br></div><div dir="ltr"><br><blockquote type="cite">On 21 Feb 2022, at 21:16, Felip Moll <lipixx@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr"></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
You could invoke a man:systemd-run for each new process. Than you can<br>
put every single job in a seperate .slice with its own<br>
man:systemd.resource-control applied.<br>
This would also mean that you don't need to compile against libsystemd.<br>
Just exec() accordingly if a systemd-system is detected.<br>
<br>
BR<br>
Silvio<br></blockquote><div><br></div><div><div>Silvio,</div><div><br></div><div>As I commented in my previous post, creating every single job in a separate slice is an overhead I cannot assume.</div><div>An HTC system could run thousands of jobs per second, and doing extra fork+execs plus waiting for systemd to fill up its internal structures and manage it all is a no-no.</div></div></div></div></div></blockquote><div><br></div>Are you assuming this or did you measure the cost?<div><div><div><div><br></div><div>Barry</div><div><br><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div><div><br></div><div>One other option that I am thinking about is extending the parameters of a unit file, for example adding a DelegateCgroupLeaf=yes option.<br></div><div><br></div><div>DelegateCgroupLeaf=<yes|no>. If set to yes an extra directory will be created into the unit cgroup to place the newly spawned service process. This is useful for services which need to be restarted while its forked pids remain in the cgroup and the service cgroup is not a leaf anymore. This option is only valid when using Delegate=yes and under a system in unified mode.<br></div><div><br></div><div>E.g. in my example, that would end up like this:<br></div><div>/sys/fs/cgroup/system.slices/sgamba1.service <------ This is Delegated=yes DelegateMultiCgroups=yes<br>├── sgamba1 <------ The spawned process would be always put in here by systemd.<br>├── user1_stuff<br>├── user2_stuff<br>└── user3_stuff</div><div><br></div><div>I think this idea could work for cases like the one exposed here, and I see this would be quite useful.</div> </div></div></div>
</div></blockquote></div></div></div></div></body></html>