We have a fairly complex Rails app that is about to be deployed onto a single physical host. The host has 8 cores and 128GB ram.
The app is dockerised, with 4 types of containers
- Rails inc. web server
- Postgres DB
- Redis DB
- Worker container (Resque)
It is expected the Rails and Worker containers will be scaled by bringing on more containers within the docker-machine.
In the development environment, memory is allocated to the entire docker-machine:
docker-machine create -d virtualbox --virtualbox-memory 8192 default
Is it possible to control how much memory individual containers are limited to?
For example allocate 16GB to Postgres, but limit Rails containers to 4GB. What sort of minimum memory should be allocated to the server host running docker-machine, and is this even possible?
This answer https://serverfault.com/a/645888/210752 indicates that the containers will allocate memory as needed. This has not been my experience in the development environment (by default the docker-machine was allocated 2GB).