[systemd-devel] Limiting resources

Lennart Poettering lennart at poettering.net
Wed Feb 23 08:42:52 PST 2011


On Wed, 23.02.11 09:43, Mike Kazantsev (mk.fraggod at gmail.com) wrote:

> > CPUShares=2048
> > CPUSetCPUs=2,3
> > 
> > which would implicitly add "cpu" and "cpuset" to the list the user can
> > otherwise control with ControlGroup=, and then write "2048" resp. "2,3"
> > to the cpu.shares resp. cpuset.cpus files in the per-daemon cgroups in
> > those directories.
> > 
> 
> Just wanted to note that knobs in cgroup fs seem to be added on
> per-release basis (next up: cpu usage hard-limit, hierarchical blkio),
> plus there's usually lot of them, so maybe it'd make sense not to
> duplicate (or even mangle) their names like that, but make a generic
> options to set any named parameters, like this:
> 
>   ControlGroupCPU=shares=300
>   ControlGroupBLKIO=weight=500 throttle.read_bps_device=1000
> 
> Looking into cgroup-systemd translation table to find out which knob
> is used for CPUSetCPUs (and maintaining such table in the first place)
> seem like a waste of time.
> 
> But then I don't have a patch with that implementation, too.

Well, it's certainly true that there are a lot of knobs, and new ones
are added all the time, but I think this is something we can keep up
with.

Using proper settings for these things is not only nicer to look at,
but often feels more natural and normal. example: if a controller
requires specification of time and the kernel only accepts that in one
unit (e.g. µs), it is kinda nice if in userspace we can convert that
from more flexible time strings such as "5min 30s" like we do for all
other time specifications in systemd.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list