Introduction
When you run applications in containers, they can use too much memory or CPU and slow down or crash your computer. Setting resource limits helps keep your system stable by controlling how much CPU and memory each container can use.
When you want to prevent one container from using all the CPU and slowing down other containers.
When you need to avoid a container crashing the host by using too much memory.
When running multiple containers on the same machine and you want to share resources fairly.
When testing how your app behaves under limited CPU or memory conditions.
When deploying apps in production to ensure reliability and avoid unexpected crashes.