我正在使用内存控制器的cgroups设置每个用户的内存限制(使用memory.limit_in_bytes设置)。 问题是这个设置也帐户caching使用情况。 因此,如果限制为1GB,并且用户仅下载或复制1GB文件,则其进程将被终止。 更糟糕的是,caching的页面仍然保留在内存中,所以即使运行零进程,用户的“内存使用量”仍然接近1GB。 自然,这是没有意义的。 我只想限制每个用户的总私有(非匿名)内存使用量。 我怎样才能做到这一点? 或者,让OOM杀手在去掉杀死进程之前尝试删除用户的caching页面,甚至不释放caching的页面。
所以我正在几台服务器上设置CGroups,而且我正在使用相当多的文档来做到这一点。 我在Fedora 资源pipe理指南的第2.8.1节中遇到了这个问题(在这个redhat指南中也奇怪的是: The entry now specifies that when the user named maria uses the ftp command, the process is automatically moved to the /usergroup/staff/ftp cgroup in the hierarchy that contains the devices subsystem. Note, however, that the daemon moves the process to the cgroup only after the appropriate condition is fulfilled. Therefore, the ftp […]
Linux有一个处理cgroup的PAM模块。 它是如何configuration的(它支持哪些选项?)
如何使用cgroups优先考虑LVM卷的I / O性能? 我知道我可以使用ionice在stream程级别进行更改,但我希望能够按LV执行此操作,而不是每个进程。
我想在Centos 6.5上试试docker-io,但是cgconfig守护进程不会启动: /etc/init.d/cgconfig restart Stopping cgconfig service: [ OK ] Starting cgconfig service: Error: cannot mount cpuset to /cgroup/cpuset: Invalid argument /sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed Failed to parse /etc/cgconfig.conf or /etc/cgconfig.d [FAILED] cgconfig.conf的内容 mount { cpuset = /cgroup/cpuset; cpu = /cgroup/cpu; cpuacct = /cgroup/cpuacct; # memory = /cgroup/memory; devices = /cgroup/devices; freezer […]
我试图限制使用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 […]
我有一个问题试图分开使用cpuset子系统2组。 这工作正常,但是如果我去添加一个子组到该组(在这种情况下 – user1),cgconfig将无法启动“无法删除非空组”。 删除组滥用者/ user1将开始完美。 然而,这打破了我所尝试的待办事项。 这里是一个例子cgconfig,将无法启动。 CentOS版本6.5(最终)2.6.32-431.5.1.el6.x86_64 libcgroup-0.40.rc1-5.el6_5.1.x86_64虚拟机内部。 mount { cpuset = /cgroup/cpuset; cpu = /cgroup/cpu; cpuacct = /cgroup/cpuacct; memory = /cgroup/memory; devices = /cgroup/devices; freezer = /cgroup/freezer; net_cls = /cgroup/net_cls; blkio = /cgroup/blkio; } group normal { blkio { blkio.throttle.write_bps_device="253:0 72428800"; blkio.throttle.read_bps_device="253:0 72428800"; blkio.reset_stats=""; blkio.weight="700"; blkio.weight_device=""; } memory { memory.limit_in_bytes = "1673003008"; […]
我pipe理几个基于Linux的服务器,我们正在考虑将几个JBoss应用程序以及运行在Apache上的几个网站从RHEL 5.5(64位)服务器迁移到RHEL 6(64位)服务器24个核心。 我的主pipe提到了使用cgroups来pipe理新服务器上的内存/ CPU分配的可能性。 我自己做了一些阅读/研究,对cgroups的目的以及他们能做什么有了很好的理解。 我的问题是,运行cgroup的优点是什么?这是pipe理JBoss应用程序的有效方法吗?
我有一个容器泄漏内存。 或者至less,报告的内存消耗快速上升。 如果我跑顶,我得到这个: top – 16:56:51 up 6 days, 17:25, 0 users, load average: 0.16, 0.27, 0.31 Tasks: 4 total, 1 running, 3 sleeping, 0 stopped, 0 zombie %Cpu(s): 1.3 us, 0.7 sy, 0.0 ni, 98.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 7676380 total, 4089380 used, 3587000 free, 675164 buffers […]
我试图在Centos 7中设置每个用户的资源限制,但是我找不到cgroups新实现的正确命令(我没有阅读文档,但是讨论了限制服务而不是用户)。 这是Centos 6中的步骤 添加到/etc/cgconfig.conf group mygroup{ cpu { cpu.shares = 200; } memory { memory.limit_in_bytes = 128m; } } 重新启动service cgconfig restart 从系统启动开始: chkconfig cgconfig on validation组是否正确添加: lscgroup 将我们希望限制资源的进程添加到我们创build的cgroup中:add to /etc/cgrules.conf myuser cpu,memory mygroup/ 启动cgred服务,使cgrulesconfiguration更改生效: service cgred start 确保cgred服务启用在系统启动时启动,以便我们的规则在重新启动时保持chkconfig cgred on : chkconfig cgred on Centos 7中的等价物是什么?