docker警告:Your kernel does not support cgroup swap limit capabilities

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/songyu0120/article/details/89170458

问题

运行docker时如果使用命令``出现如下警告:

WARNING: Your kernel does not support swap limit capabilities. Limitation discarded.

解决方案

这是在ubuntu或其他基于Debian的系统上才会出现的问题,原因是系统默认未开启swap限制。(开启后会使系统内存占用多1%,性能下降约10%,即使没有运行docker)

Memory and swap accounting incur an overhead of about 1% of the total available memory and a 10% overall performance degradation, even if Docker is not running.

开启方法:

  • 首先使用sudo -i获取系统sudo权限
  • 修改系统的/etc/default/grub file文件。使用vim在这个文件中添加一行:
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
  • 更新系统的GRUB:
sudo update-grub

改动在系统下次重启后生效。

参考

官方链接:https://docs.docker.com/install/linux/linux-postinstall/#your-kernel-does-not-support-cgroup-swap-limit-capabilities

猜你喜欢

转载自blog.csdn.net/songyu0120/article/details/89170458