简体   繁体   中英

How does the container use more memory than the limit?

My project might be an overcommitted system, and I have to improve the reliability by specifying an appropriate container mem limit, by which the total mem of the node should not be divided. But I'm confused with the following statements in the Kubernetes v1.1 doc Resource of Qos :

Incompressible Resource Guarantees

  • if they exceed their memory request, they could be killed (if some other container needs memory)

  • Containers will be killed if they use more memory than their limit.

and the command docker stats shows a "LIMIT" for each container:

在此处输入图片说明

I think it means that containers will not use mems more than the "LIMIT" since I've met sometimes the MEM% stays at 100% for a while, so how and when the containers are killed?

Update

I think OOM Killer is enabled with the default value 0 .

> cat /proc/sys/vm/oom_kill_allocating_task
0

Cgroup memory limit feature is used, so I recommend to read cgroup doc:

Tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer.

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/sec-memory.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM