Determine how many containers can run per host given CPU, memory and overhead.
Container density is limited by whichever resource (CPU or memory) runs out first. Formula: maxContainers = min(availableCPU/cpuPerContainer, availableMemory/memoryPerContainer), after reserving resources for the OS and Docker daemon.
Max Containers
max = min(availableCPU / cpuPerContainer, availableMemory / memPerContainer)
For predictable density planning yes, but in practice many teams set limits higher than requests to allow bursting when other containers are idle, improving utilization at the cost of predictability.
Linux kernels have a default PID limit (~32768) shared across all containers. Very high container density with many threads per container can hit this before CPU/memory limits.