简体   繁体   English

Docker和ram的用法

[英]Docker and ram usage

I have a swarm cluster with 24Gb of RAM on each nodes. 我有一个群集集群,每个节点上都有24Gb的RAM。

Free -g shows 6Gb used but I get some OutMemory errors on some java or elasticsearch containers. Free -g显示使用了6Gb,但在某些Java或elasticsearch容器上却出现OutMemory错误。

  total used free shared buff/cache available Mem: 23 6 6 0 10 16 Swap: 1 0 1 

I removed all reservation or limits on containers 我删除了对容器的所有保留或限制

Any idea what causes the OutOfMermory ? 任何想法导致OutOfMermory的原因吗? I did set Xmx on the containers and they are not using to much RAM... 我确实在容器上设置了Xmx,但它们并没有占用太多内存...

Thanks a lot 非常感谢

I found the problem. 我发现了问题。

It was a kernel configuration in the sysctl.conf. 它是sysctl.conf中的内核配置。

I had this : 我有这个:

cat /etc/sysctl.conf |grep vm.
vm.swappiness=10
vm.overcommit_memory=2
vm.dirty_ratio=2
vm.dirty_background_ratio=1

I removed everything setted for DB2 (put back the default configuration) and now I can take advantage of all the RAM of the hosts. 我删除了为DB2设置的所有内容(放回默认配置),现在我可以利用主机的所有RAM。

I kept this : 我保留了这个:

cat /etc/sysctl.conf |grep vm.
vm.swappiness=10
vm.max_map_count=262144

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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