CPU was around 90%+-(htop confirm this and I saw some spikes to up to 91%) and when RAM was close to 1. In the 2nd window, I ran the docker stats command. Then I ran docker container with: docker run -name stress-test -d ubuntu:18.04 sleep 10000Īnd opened my VM in 2 windows. Therefore I created the slice with next parameters: # cat /etc/systemd/system/docker_limit.sliceĪnd I made literally the same things as you, except native cgroupdriver in daemon: # cat /etc/docker/daemon.json I have a VM with 1 CPU and 2GB RAM (swap disabled). I think I've missed something but I don't know what I can see from docker stats it's using near 1600 % (full capacity of my server) 1GB available to Docker containers, usage is actual usage 1.32GB in activity monitor, compared to the 1. I can see from docker stats it's using 111Go of Ram (full capacity of my server) stress -cpu 16 Docker settings: CPU 4, mem 4 GB, swap 1 GB image + (pod) CPU Memory GB docker - 4 4,7 - 6.8 redis 7 redis+mongo 9 docker-desktop with K8s ca 20 k8sXXX + (1 redis) 37 ca 20 k8sXXX + (10 redis) 42 ca 20 k8sXXX + (100 redis) 71 docker with minikube gcr.io/k8s-minikube + (1 redis) 50 (80 after one hour) gcr. to be fair I set my docker context to use a different device than my M1 macbook. "insecure-registries" : ,īut when I try from a container: stress -vm-bytes $(awk '/MemAvailable/' < /proc/meminfo)k -vm-keep -m 1 I have around 20 containers which can consume the maximum CPU and memory but not at the same time, so I cannot set the CPU and RAM limit, that's why I need to limit the total resource used by dockerįirst of all I've created a slice: I tried the instruction above, but impossible to limit both the RAM and the CPU usage # /etc/systemd/system/docker_limit.sliceĭescription=Slice that limits docker resources I cannot use CPU and RAM limit when I'm launching my containers, that's why I need to limit the total resources available for docker containers. I'm trying to limit the total resources accessible from docker (for example only 90% of the RAM and 1500% of the CPU).