一个osd应该分配多少内存?最近在测试ceph集群,发现osd占用的内存随着写入的数据越来越多,占用的内存也越来越多,最终都把系统内存完了。
root 31383 28.2 8.3 2593676 920976 ? Ssl Mar01 332:07 /usr/local/hstor/ceph_dir/bin/ceph-osd -i 42 --pid-file /var/run/ceph/osd.42.pid -c /usr/local/hstor/ceph_dir/etc/ceph/ceph.conf --cluster ceph
root 32534 21.2 8.4 2591672 936432 ? Ssl Mar01 249:22 /usr/local/hstor/ceph_dir/bin/ceph-osd -i 44 --pid-file /var/run/ceph/osd.44.pid -c /usr/local/hstor/ceph_dir/etc/ceph/ceph.conf --clust
现在分配了多少内存出现问题了呢? ceph 集群出现异常比如数据重平衡会大量使用内存, OSD 内存消耗通常与系统中每个守护进程的 PG 数有关。内存问题需要多注意,内存不够会导致 osd 重启,集群异常。 ceph.com 也给出了推荐的 osd 内存配置,可以参考一下建议3-5GB吧
By default, OSDs that use the BlueStore backend require 3-5 GB of RAM. You can adjust the amount of memory the OSD consumes with the osd_memory_target configuration option when BlueStore is in use. When using the legacy FileStore backend, the operating system page cache is used for caching data, so no tuning is normally needed, and the OSD memory consumption is generally related to the number of PGs per daemon in the system.
收起