mount { cpu = /sys/fs/cgroup/cpu; cpuacct = /sys/fs/cgroup/cpuacct; cpuset = /sys/fs/cgroup/cpu; devices = /sys/fs/cgroup/devices; memory = /sys/fs/cgroup/memory; freezer = /sys/fs/cgroup/freezer; } group mon { perm { task { uid = root; gid = root; } admin { uid = root; gid = root; } } cpu { cpuset.cpus = 0; cpuset.mems = 0; } memory { memory.limit_in_bytes = 2g; memory.memsw.limit_in_bytes = 3g; memory.soft_limit_in_bytes = 1g; memory.swappiness = 0; memory.oom_control = 1; memory.failcnt = 1; } } group osd0 { perm { task { uid = root; gid = root; } admin { uid = root; gid = root; } } cpu { cpuset.cpus = 1; #綁定到指定的cpu cpuset.mems = 0,1; } memory { memory.limit_in_bytes = 2g; #物理內存限制爲2G memory.memsw.limit_in_bytes = 3g; #swap虛擬內存限制爲3G memory.soft_limit_in_bytes = 1g; #當物理內存成果1G將觸發內存回收 memory.swappiness = 0; #優先使用物理內存 memory.oom_control = 1; #當內存到達上限,不關閉進程,只將對應進程進入sleep狀態 memory.failcnt = 1; #報告當內存到達memory.limit_in_bytes次數 } }
Mon服務配置 修改/etc/init/ceph-mon.conf配置以下 app