Docker service disable memory swap

无人久伴 提交于 2021-02-10 06:13:38

问题


can i set “MemorySwap” and “MemorySwappiness” for docker service? I would like to disable memory swap for docker containers (started by docker service) but i don’t want to disable it for host machine. What means value of -1 at “MemorySwappiness”?

Docker version: 17.06.2-ce


回答1:


Although this question is old, as it has no answer I have decided to post one.

Indeed, disabling memory swap is now supported by just using the option --memory-swap when creating the container. You simply have to set --memory and --memory-swap to the same value, according to the docs.

For more information about memory swapping, visit this page of the docs about constraining resource access.



来源:https://stackoverflow.com/questions/47408800/docker-service-disable-memory-swap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!