โดยค่าเริ่มต้น container สามารถใช้ ทรัพยากรของ host ได้ไม่จำกัด — ซึ่งเสี่ยงที่ container หนึ่งจะแย่งทรัพยากรจากตัวอื่นหรือทำให้ host crash Docker ให้คุณตั้ง resource limits (CPU, memory) เพื่อควบคุมการใช้งาน ซึ่งสำคัญต่อความเสถียรและการแบ่งปันทรัพยากรอย่างเป็นธรรมใน production
ปัญหา: การใช้ทรัพยากรแบบไม่จำกัด
BY DEFAULT a container can consume ALL available host CPU and memory:
→ a buggy/busy container (memory leak, runaway loop) can starve other containers
or crash the entire host (out of memory)
→ In production (multiple containers per host), LIMIT resources to isolate them.
