[Users] limit cpu per user

Scott Dowdle dowdle at montanalinux.org
Fri Jun 3 08:43:20 PDT 2016


Greetings,

----- Original Message -----
> is it possible now to limit CPU per user inside CT? I assume it
> should be possible with cgroups but I don't know what exactly keywords
> should I google.
> 
> kernel - latest openvz6

Linux systems have the limits.conf file where you can limit various user resources on a per-user or a per-group basis... but like nice and renice... they aren't optimal... and the reason cgroups were created.

Of course almost no one (other than hardcore enterprise admins) uses cgroups directly because they aren't easy... until systemd automated them by doing most of the work for you by starting each service in a cgroup... and users too... with various resources being tunable via unit files and/or drop-in files... which are primarily for services and service accounts.  While user stuff is a cgroup, I'm not aware of an easy way to do per-user customization... but maybe there is a way via drop-in files for logind?  That last paragraph was more of a review without much deep knowledge of the subject... but hopefully gives you a tiny bit more background.

On non-systemd-based distros... you are left to figure out cgroups on your own... and I don't really have any good resources to point to because I haven't tried to figure that out.

I have to wonder though how much of systemd and it's management of cgroups works under OpenVZ?  Maybe all of it works just fine... I'm just not sure as I haven't really tried to used systemd drop-in files and the resource controls they offer within OpenVZ... because OpenVZ's resource limits have been good enough for me for per-container stuff... but no.. not per-user inside of a container... other than level 2 disk quotas which I haven't really used.

Maybe someone here has used systemd cgroup based user resource controls within OpenVZ and can tell us all about it?!?

TYL,
-- 
Scott Dowdle
704 Church Street
Belgrade, MT 59714
(406)388-0827 [home]
(406)994-3931 [work]


More information about the Users mailing list