Setting resource limits on rootless containers

Setting resource limits on rootless containers

Content #

Deletation under cgroup Version 2 is perfectly safe. Open the /lib/systemd/system/user@.service file:

Delegate=pids memory

By default, onn-privileged users are only allowed to set resource limits for memory and for the maximum number of running processes. Edit the Delegate= line so that it will look like this:

Delegate=pids memory io cpu cpuset

Create an Ubuntu container:

podman run -it --cpu-period=100000 --cpu-quota=50000 ubuntu /bin/bash

inspect the running container:

podman inspect container_name

Their should have something like this:

"CpuPeriod": 100000,
"CpuQuota": 50000,

From #