MDRAID10 Extremely Slow Random Writes: Solution for OpenSuSE 15.4
In this article, we will discuss a common issue faced by some users when using the MD RAID10 setup on OpenSuSE 15.4, where random writes perform extremely slow. We will cover the key concepts related to this issue and provide a detailed solution to resolve it.
Background
MD RAID10 is a popular software RAID solution that combines the advantages of RAID0 and RAID1. It provides high data throughput, redundancy, and fault tolerance. However, some users have reported experiencing extremely slow random write speeds when using MD RAID10 on OpenSuSE 15.4.
The Issue
The issue manifests itself as extremely slow random write speeds when performing IO-intensive tasks such as file transfers, backups, or database operations. This can be frustrating for users who rely on high-performance storage for their workloads.
Cause
The cause of this issue is not entirely clear, but it is believed to be related to the way the Linux kernel handles MD RAID10 write operations. Specifically, the kernel may be performing unnecessary read-modify-write cycles, which can significantly slow down random write speeds.
Solution
The solution to this issue is to modify the MD RAID10 settings to use the "write-mostly" option. This option tells the kernel to perform write-back caching for the RAID array, which can significantly improve random write speeds.
Step-by-step guide
- Identify the MD RAID10 array by running the following command:
mdadm --detail /dev/md0Replace "/dev/md0" with the name of your MD RAID10 array.
- Edit the MD RAID10 array configuration file by running the following command:
nano /etc/mdadm.confAdd the following line to the configuration file:
device /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1Replace "/dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1" with the device names of your RAID array.
- Add the "write-mostly" option to the MD RAID10 array by running the following command:
mdadm --grow /dev/md0 --bitmap=internal --layout=o2 --chunk=512K --write-mostlyReplace "/dev/md0" with the name of your MD RAID10 array.
- Verify that the "write-mostly" option has been added by running the following command:
cat /proc/mdstatTesting
To test the solution, perform a random write test on your MD RAID10 array. You can use a tool such as "fio" to perform this test. Here is an example command to test random writes:
fio --name=randwrite --ioengine=libaio --iodepth=64 --rw=randwrite --bs=4k --size=1G --numjobs=8 --runtime=60 --group_reporting --filename=/dev/md0Replace "/dev/md0" with the name of your MD RAID10 array.
In this article, we discussed the issue of extremely slow random writes on MD RAID10 arrays on OpenSuSE 15.4. We covered the key concepts related to this issue and provided a detailed solution to resolve it. By following the step-by-step guide, users can modify their MD RAID10 settings to use the "write-mostly" option and significantly improve random write speeds.
References
- MD RAID10 slow writes on Linux (https://serverfault.com/questions/971421/md-raid10-slow-writes-on-linux)
- MD RAID10 performance tuning (https://raid.wiki.kernel.org/index.php/RAID10#Performance_tuning)
- MD RAID10 write-mostly option (https://man7.org/linux/man-pages/man4/md.4.html)