I have a docker-compose.yml file that I call to deploy my container and it seems to work fine however when I look at the container statistics, I can’t see my resource limits being honored for CPU / RAM.
Here are the container stats from running “docker-compose up -d”:
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
ee5bbad3c458 db1 0.02% 126.2MiB / 15.55GiB 0.79% 5.61MB / 7MB 184MB / 357MB 8
Below is my docker compose yaml file:
# docker-compose.yml
version: '3'
services:
database:
image: postgres # use latest official postgres version
restart: always
container_name: db1
ports:
- 5432:5432
deploy:
resources:
limits:
cpus: 2
memory: 2G
volumes:
- /mnt/docker/postgresql/db1/pgdata:/var/lib/postgresql/data/
I am not getting any errors when I run
docker-compose up -d
The container is running fine but appears to not honor the resource limits. Appreciate any help on why…