首页 > 解决方案 > Ceph 磁盘在小块大小上 dd oflag=dsync 写入缓慢

问题描述

我们部署了一个 ceph 版本 12.2.5 的 ceph 集群,使用 Dell R730xd 服务器作为存储节点,使用 10 个 7.2k NLSAS 驱动器作为 OSD。我们有 3 个存储节点。

我们没有配置 RAID 设置,而是直接使用驱动器来创建 OSD。

我们使用 ceph-ansible-stable-3.1 来部署 ceph 集群。

我们在使用 RBD 映像的 VM 中的磁盘写入测试中遇到性能缓慢的问题。

[root@test-vm-1 vol2_common]# dd if=/dev/zero of=disk-test bs=512 count=1000 oflag=direct ;  dd if=/dev/zero of=disk-test bs=512 count=1000 oflag=dsync ; dd if=/dev/zero of=disk-test bs=512 count=1000
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 0.101852 s, 5.0 MB/s
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 21.7985 s, 23.5 kB/s
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 0.00702407 s, 72.9 MB/s

检查 OSD 节点时,在 osd 目录下,我们发现同样的磁盘速度较低。

[root@storage01moc ~]# cd /var/lib/ceph/osd/ceph-26
[root@storage01moc ceph-26]#  dd if=/dev/zero of=disk-test bs=512 count=1000 oflag=direct ;  dd if=/dev/zero of=disk-test bs=512 count=1000 oflag=dsync ; dd if=/dev/zero of=disk-test bs=512 count=1000
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 14.6416 s, 35.0 kB/s
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 9.93967 s, 51.5 kB/s
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 0.00591158 s, 86.6 MB/s

我们怀疑问题的原因是在单个 OSD 驱动器上未使用任何 RAID 配置 (RAID 0) 时没有可用的硬件缓存。


Ceph 配置

[global]
fsid = ....
mon initial members = ...
mon host = ....
public network = ...
cluster network = ...  
mon_pg_warn_max_object_skew=500

[osd]
osd mkfs type = xfs
osd mkfs options xfs = -f -i size=2048
osd mount options xfs = noatime,largeio,inode64,swalloc
osd journal size = 10240

[client]
rbd cache = true
rbd cache writethrough until flush = true
rbd_concurrent_management_ops = 20

磁盘详细信息

=== START OF INFORMATION SECTION ===
Vendor:               TOSHIBA
Product:              MG04SCA60EE
Revision:             DR07
Compliance:           SPC-4
User Capacity:        6,001,175,126,016 bytes [6.00 TB]
Logical block size:   512 bytes
Physical block size:  4096 bytes
Formatted with type 2 protection
Rotation Rate:        7200 rpm
Form Factor:          3.5 inches
Device type:          disk
Transport protocol:   SAS (SPL-3)
Local Time is:        Wed Aug  1 20:59:52 2018 +08
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Disabled or Not Supported

如果我们缩小 OSD 并在驱动器上使用 RAID 0 并重新创建 OSD,请告诉我,这对增加磁盘写入有帮助吗?

提前致谢。

标签: ddceph

解决方案


当我们在存储控制器上为每个 OSD 驱动器配置 RAID0 时,磁盘写入问题得到了解决。

识别为 RAID 控制器写入缓存的缓慢原因不适用于未配置任何 RAID 级别的驱动器。


推荐阅读