systemdspawner icon indicating copy to clipboard operation
systemdspawner copied to clipboard

systemdspawner doesn't activate cpu_limit in v219 systemd

Open whositwhatnow opened this issue 5 years ago • 0 comments

Bug description The class cpu_limit doesn't work. I've applied but the maximum number of CPUs used are 0.25 (in a server with 192)

Expected behaviour The handling of cpu_limit, allowing the maximum per user.

Actual behaviour The amount of CPU used are always ONE

How to reproduce With a systemd v219, apply the systemdspawner and set c.SystemdSpawner.cpu_limit = X

Your personal set up OS: Linux Version: Red Hat 7 JupyterHub: 1.1.0

Similar to #69 post.

I've set the CPU limit to 0.25, and it does not seem to activate that limit.

systemdspawner configuration

c.SystemdSpawner.mem_limit = '1G'
c.SystemdSpawner.cpu_limit = 0.25
c.SystemdSpawner.user_workingdir = '/home/{USERNAME}'
#c.SystemdSpawner.username_template = 'jupyter-{USERNAME}'
#c.SystemdSpawner.default_shell = '/bin/bash'
#c.SystemdSpawner.extra_paths = ['/home/{USERNAME}/conda/bin']
c.SystemdSpawner.unit_name_template = 'jupyter-{USERNAME}-singleuser'
#c.SystemdSpawner.unit_extra_properties = {'LimitNOFILE': '16384'}
#c.SystemdSpawner.isolate_tmp = True
#c.SystemdSpawner.isolate_devices = True
#c.SystemdSpawner.disable_user_sudo = True
#c.SystemdSpawner.readonly_paths = ['/']
#c.SystemdSpawner.readwrite_paths = ['/home/user/{USERNAME}']
#c.SystemdSpawner.dynamic_users = True

results from log, I've only added the quota portion:

CPUAccounting=yes
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=250ms
BlockIOAccounting=no
BlockIOWeight=18446744073709551615
StartupBlockIOWeight=18446744073709551615
MemoryAccounting=yes
MemoryLimit=1073741824

whositwhatnow avatar Sep 14 '20 11:09 whositwhatnow