简体   繁体   English

限制 linux 上 docker 的 RAM 使用

[英]Limit RAM usage of docker on linux

In windows we can specify the RAM limit for WSL thus limiting the RAM usage of docker as a whole .在 windows 中,我们可以指定 WSL 的 RAM 限制,从而限制整个 docker的 RAM 使用。

Can i do something similar in linux ?我可以在linux中做类似的事情吗?

Google search only shows way to limit the usage of induvudual containers.谷歌搜索只显示了限制使用单个容器的方法。

Thanks in advance..提前致谢..

As explained by theDocker Official Guide you can set limits on memory and cpu (this one only for swarms ).正如Docker 官方指南所解释的那样,您可以设置 memory 和 cpu 的限制(这仅适用于swarms )。

You can limit memory and CPU on docker daemon with help of systemd unit:您可以在 systemd 单元的帮助下限制 docker 守护进程上的 memory 和 CPU:

https://unix.stackexchange.com/questions/537645/how-to-limit-docker-total-resources https://unix.stackexchange.com/questions/537645/how-to-limit-docker-total-resources

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

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