Improving the Speed of Software Raid on Linux (Read/Write/Resync)

Speeding up the write access of a RAID array

echo 32768 > /sys/block/md0/md/stripe_cache_size

Source: Stackoverflow

Speeding up RAID1 array rebuild


echo 50000 > /proc/sys/dev/raid/speed_limit_min
echo 200000 > /proc/sys/dev/raid/speed_limit_max

the resync speed went from 1M/sec to about 25M/sec:

cat /proc/mdstat

Personalities : [raid1]
md1 : active raid1 sdb3[0] sda3[1]
      410024768 blocks super 1.2 [2/2] [UU]
      [>....................]  resync =  0.7% (3086912/410024768) finish=625.8min speed=10836K/sec

unused devices: <none>

Probably you may also change something here:

for syncmd in /sys/block/md1/md/sync*; do echo $syncmd; cat $syncmd; done

Watching the rebuild process:

apt-get install sysstat

watch iostat -k 1 2
# and
watch cat /proc/mdstat

After the resync, I should create a bitmap on the drive so that the raid array will sync faster after time-limited drive unavailability in the future:

mdadm --grow --bitmap=internal /dev/md0