Hi Carla,
probably cgroups are better in constraining resource usage.
It should be possible to runwith cgexec singularity on a simple cgroup
cpu controller rule set [1] and the kernel should take care.
It worked for me in a quick test with an on-the-fly cgroup [2] - but for
something consistent, you probably want to define proper rule sets via
/etc/cgrules.conf
Cheers,
Thomas
[1]
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/resource_management_guide/starting_a_process
https://www.antonlindstrom.com/2015/11/22/limit-processes-with-cgexec.html
[2]
> cgcreate -g cpu:singufoo
> echo 200 > /sys/fs/cgroup/cpu/singufoo/cpu.shares
> cgexec -g cpu:singufoo singularity shell /your/container/path/
> cat /sys/fs/cgroup/cpu,cpuacct/singufoo/cpu.shares
200
> cat /sys/fs/cgroup/cpu,cpuacct/singufoo/tasks
20381
# which is the shell's PID in the container
btw: watch out for hierarchies in resource usages, i.e., if you nest
cgroups where 200 become from 200 from 1000 from the whole CPU share
etc. - I just stumbled over this one... ;)
> --
> You received this message because you are subscribed to the Google
> Groups "singularity" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
singularity...@lbl.gov
> <mailto:
singularity...@lbl.gov>.