My server has 2GB mem
I launched 2 containers in the server with docker-compose
Although I set the memory limiti, but it seems not work
docker-compose
hub:
mem_limit: 256m
image: selenium/hub
ports:
- "4444:4444"
test:
mem_limit: 256m
build: ./
links:
- hub
ports:
- "5900"
This is not documented anywhere in docker-compose, but you can pass any valid system call
setrlimit
option inulimits
.So, you can specify in
docker-compose.yaml
ulimits: as: hard: 130000000 soft: 100000000
memory size is in bytes. After going over this limit your process will get memory allocation exceptions, which you may or may not trap.