[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mdadm: speedup resync process



On 11/10/25 at 17:03, Michael Stone wrote:
On Sat, Oct 11, 2025 at 11:00:27AM -0400, Michael Stone wrote:
On Fri, Oct 10, 2025 at 08:55:38PM +0200, Franco Martelli wrote:
Is it safe and the right thing to do increase the value of: "stripe_cache_size"? The default value is:

~# cat /sys/block/md0/md/stripe_cache_size
256

no

or play with "speed_limit_max" value, the default is:

~# cat /proc/sys/dev/raid/speed_limit_max
200000

yes, increase this. I usually use a value of 10000000 (effectively "no limit"). So why does this tunable exist? The general idea is to make it possible to ensure that a RAID resync doesn't starve out other use of the array, by setting a lower maximum bandwidth. The value of 200MByte/s was chosen 20 years ago as a number well in excess of drive speeds...but drives have gotten a lot faster while the default hasn't changed. A SATA SSD can hit about 550MByte/s on a RAID resync, and even a good modern hard drive can get over 250MByte/s. NVMe storage can easily get over a GByte/s, once the speed limit is raised.

Oh, and for RAID5, check /sys/block/md0/md/group_thread_cnt

Does "group_thread_cnt" set the number of threads should be used for the resync like the -j switch of the "make" command sets the number of threads? The default is:

$ cat /sys/block/md0/md/group_thread_cnt
0

Where "speed_limit_max" and "group_thread_cnt" should be placed to set their value? Should I create a new file (say: local.conf) in "/etc/sysctl.d/" directory? Is it possible to set these values in "etc/default/grub" via "GRUB_CMDLINE_LINUX_DEFAULT" variable.


I'd also generally recommend a pair of mirrors over a 4 disk RAID5.

Thanks, kind regards.

--
Franco Martelli


Reply to: