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

问题

运行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

  • 7
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

江前云后

文章结束的标识:打赏链接

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值