First, turn off all other activity on the box so RAID resync is the only thing going on.
Next, set /proc/sys/dev/raid/speed_limit_max and /proc/sys/dev/raid/speed_limit_min to higher values. Out of the box, speed_limit_max was set to 600000 which wasnât bad. Setting it to 700000 didnât speed things up in my case, but if you have a very low value (or no value), it might help.
Modify these commands to suit your needs:
echo 600000 > /proc/sys/dev/raid/speed_limit_max
echo 100000 > /proc/sys/dev/raid/speed_limit_min
Finally, modify /sys/block/md2/md/stripe_cache_size so the system can work in bigger chunks. A lot of systems default to 512. Synology defaults to 1024. I bumped it up to 4096. Note that this command is RAID-device specific (in this case, my md2 RAID device) â so donât copy/paste this command blindly.
echo 4096 > /sys/block/md2/md/stripe_cache_size
I wouldnât leave it set at that forever but for resyncs, it seemed to help a bit.
Cumulatively, these settings improved performance by about 15%. Iâd guess the stripe_cache_size was the main contributor to the improvement. Since the system is idle except for the resync, there shouldnât be any other work on the disk fighting for I/O where speed_limit_min would come into the picture.
Two days later, my RAID resync is still running but these tricks shaved about 8 hours off of it.
Thanks to @luckypenguin for the tips!