[systemd-devel] issues setting limits on the fly for services/scopes in user slice

jsl6uy js16uy js16uy at gmail.com
Fri May 27 14:03:01 UTC 2016


Hello All, hope all is well

On arch linux
Linux X 4.5.3-1-ARCH #1 SMP PREEMPT Sat May 7 20:43:57 CEST 2016 x86_64
GNU/Linux
local/libsystemd 229-3
    systemd client libraries
local/systemd 229-3
    system and service manager
local/systemd-sysvcompat 229-3 (base)
    sysvinit compat for systemd


using......
systemd-run --user --unit=foo --scope stress -c 1
I can see the scope created under my user slice
In top I can see the cpu pegged
I run
systemctl --user set-property foo.scope CPUQuota='5%'
or
systemctl set-property --user --runtime foo.scope CPUQuota='5%'
or couple other postitional variations
Also tried CPUShares as the controlling resource knob

However the process remains at 100% usage on top

Same multicore host
When I set resource properties on the fly on a vm in a scope running in the
machine slice launched by libvirt, I do see cpu usage drop accordingly.
-Fired up an ubu vm ran stress and/or stress-ng -c1 inside the vm
-systemctl set-property 'machine-qemu\x2d68\x2dchhq\x2dvulr6isi02.scope'
CPUQuota='5%'
-cpu usage in host drops to the expected amount


CentOS Linux release 7.2.1511 (Core)
On Centos 7u2 , I can't do exactly the same b/c
--no user option in systemd-run
--I am at the version where --slice is not working with setting a scope
So I run as a service
systemd-run --unit=foo  --uid=2020 --gid=2020 --slice=user-2020.slice
stress -c 1
systemctl set-property foo CPUQuota='5%'

And I see stress hauled down to 5% usage

Am I doing something wrong for on the fly process corralling that is under
the user slice?

I can provide more info if needed

thanks for any/all help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160527/83481f55/attachment.html>


More information about the systemd-devel mailing list