I am trying to set CPU and Memory limit on spawned Jupyter notebooks from the Hub, but it still reflects host CPU and memory:
c.DockerSpawner.cpu_guarantee = 4
c.DockerSpawner.cpu_limit = 8
c.DockerSpawner.mem_guarantee = 8e+9
c.DockerSpawner.mem_limit = 1.6e+10
That seems like it should work…maybe try using just c.Spawner instead of c.DockerSpawner? You can use c.Spawner.mem_limit = ‘8.0G’ instead of scientific notation.
The only other problem I can think of is if your docker isn’t using cgroups. If you run
docker update --cpus=8 <container id> does that work?