“ docker run --memory”不占巨页 [英] "docker run --memory" doesn't account hugepages
问题描述
docker在特权模式下运行。
我想知道是否会发生这种情况。
docker is running in privileged mode. I want to know if this behavior is expected.
我正在容器中运行基于DPDK的应用程序。
我的服务器总共有128G内存,但我将容器内存资源限制为4G。我可以在docker stats中看到
。
I am running DPDK based application in container. My server has total 128G memory, I have limited container memory resource to 4G. which I can see in docker stats.
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS [0/18152]
4deda4634b22 my_docker 38.12% 1.455GiB / 4GiB 36.37% 1.53kB / 0B 1.94GB / 755MB 69
我看到,即使在docker内存限制为4G之后。
应用程序能够分配32G巨大页面内存以及其他非巨大页面内存。
是预期的吗?
docker run --memory选项仅适用于非大容量页面内存吗?
I am seeing that even after docker memory is constraint to 4G. application is able to allocate 32G huge pages memory along with other non huge page memory. Is it expected? Does docker run --memory option work only with non-huge page memory?
root@server# docker exec -ti my_docker bash
root@4deda4634b22:/#
root@4deda4634b22:/# ps aux |grep riot
root 893 17.2 0.0 68345740 105260 pts/0 Sl 05:54 1:02 /app/riot <<<<<< application.
root@4deda4634b22:/# cat /proc/meminfo |grep -i huge
AnonHugePages: 909312 kB
ShmemHugePages: 0 kB
**HugePages_Total: 32**
**HugePages_Free: 0**
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 1048576 kB
root@4deda4634b22:/# ls -rlt /mnt/huge/* | wc -l
32
推荐答案
我通常会通过通过 docker访问大型页面和vfio设备-it --privileged -v / sys / bus / pci / drivers:/ sys / bus / pci / drivers -v / sys / kernel / mm / hugepages:/ sys / kernel / mm / hugepages -v / sys / devices / system / node:/ sys / devices / system / node -v / dev:/ dev
。
您似乎丢失了同样的东西。
It looks like you are missing the same.
这篇关于“ docker run --memory”不占巨页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!