fly*_*yer 4 memory memory-management docker
我正在使用Ubuntu14.04和docker1.10.3.
当我执行docker run时--memory-swap -1,我发现主机使用的内存超出了容器可以使用的最大内存,并且主机上没有其他进程消耗大量内存.下面的图像是我在计算机上进行的测试:
第1部分是主机上的内存使用情况.
第二部分是在容器中运行的测试,用于使用压力在容器中使用900M内存进行模拟.
第3部分docker stats用于查看容器的当前统计数据.
我发现尽管docker stats显示容器使用的内存不超过104.9M,但在主机上使用的内存远远超过104.9M.似乎--memory-swap -1允许容器尽可能多地使用内存.
这是真的吗?
是的,你是对的.
你可以在docker引用中找到更多(虽然这个问题没有在那里清楚地说明).
--memory-swap="" Total memory limit (memory + swap, format: <number>[<unit>]). Number is a positive integer. Unit can be one of b, k, m, or g.
--memory-swap -1 ...disabled swap memory limit, this means the processes in the container can use as much swap memory as they need (if the host supports swap memory).
如果你想禁用容器的交换使用,你可以使用
--memory-swap=0
| 归档时间: |
|
| 查看次数: |
5710 次 |
| 最近记录: |