linux cgoup内存限制,linux – CGroups内存限制不起作用

我试图使用CGroups限制LXC容器的内存使用,但我无法限制内存.

# lxc-cgroup -n maxdaniel981 memory.limit_in_bytes 134217728

lxc_container: Failed to assign '134217728' value to 'memory.limit_in_bytes' for 'maxdaniel981'

然后我查了/ proc / cgroups:

# cat /proc/cgroups

#subsys_name hierarchy num_cgroups enabled

cpuset 2 3 1

cpu 3 3 1

cpuacct 3 3 1

memory 0 1 0

devices 4 3 1

freezer 5 3 1

net_cls 6 3 1

blkio 7 3 1

perf_event 8 3 1

net_prio 6 3 1

它看起来像cgroups_memory被禁用,但我在/ etc / default / grub中启用了内核标志并使用update-grub更新了grub

# cat /etc/default/grub

# If you change this file,run 'update-grub' afterwards to update

# /boot/grub/grub.cfg.

# For full documentation of the options in this file,see:

# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0

GRUB_TIMEOUT=5

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

GRUB_CMDLINE_LINUX_DEFAULT="cggroup_enable=memory swapaccount=1"

GRUB_CMDLINE_LINUX="cggroup_enable=memory swapaccount=1"

CGroup安装在/ etc / fstab中就像这样;

cgroup /sys/fs/cgroup cgroup defaults 0 0

有人可以帮我解决这个问题吗?我使用的是Debian Jessie,我的内核版本是3.16.0-4-amd64.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值