gpt4 book ai didi

docker - 与 Ubuntu 相比,为什么 SLES 12 上的 docker 容器占用 2 倍内存?

转载 作者:行者123 更新时间:2023-12-02 19:36:25 24 4
gpt4 key购买 nike

我注意到,与 Ubuntu 上的相同容器相比,我在 SLES 12 上的 docker 容器占用了大约 2 倍的内存。相同版本的 docker 。

例如,运行 selenium/hub,不运行任何测试(根本不对容器做任何事情),这是大约 1 分钟后的 docker stats:

只是加载 Selenium /集线器,而不做任何事情(没有测试等):

第 12 课:

CONTAINER    CPU % MEM USAGE / LIMIT   MEM %    NET I/O       BLOCK I/O     PIDS
8ce43b4e9a23 0.06% 149.1MiB / 15.6GiB 0.93% 0B / 0B 57.5MB / 0B 0

Ubuntu:
CONTAINER    CPU % MEM USAGE / LIMIT     MEM %   NET I/O       BLOCK I/O       PIDS
05d3140608b4 0.12% 74.79 MiB / 15.67 GiB 0.47% 0 B / 648 B 0 B / 8.19 kB 26

有任何想法吗?

最佳答案

docker info 的输出是什么?

在 Ubuntu 上,默认存储驱动程序是 aufs而 SLES 使用 devicemapperbtrfs .

以上链接摘录:

Memory usage: the devicemapper uses more memory than some other storage drivers. Each launched container loads one or more copies of its files into memory, depending on how many blocks of the same file are being modified at the same time. Due to the memory pressure, the devicemapper storage driver may not be the right choice for certain workloads in high-density use cases.



-

Page caching. Btrfs does not support page cache sharing. This means that each process accessing the same file copies the file into the Docker hosts’s memory. As a result, the btrfs driver may not be the best choice high-density use cases such as PaaS.



SLES 12 支持的存储驱动程序:

https://www.suse.com/documentation/sles-12/singlehtml/book_sles_docker/book_sles_docker.html#Docker_Used_Drivers

我想你可以使用 覆盖2 如果您使用 4.4.21 内核升级到 SP2。

https://www.novell.com/support/kb/doc.php?id=3594951

关于docker - 与 Ubuntu 相比,为什么 SLES 12 上的 docker 容器占用 2 倍内存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44634467/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com