mdadm - RAID6 Tweaks

After reconfiguring a server to use RAID6 with LUKS instead of RAID10 I noticed the sequential performance was abysmal. This is mostly due to the fact that the strip_cache_size is set to 512 by default.

md0 is the RAID array with 4 disks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Read ahead
blockdev --setra 65536 /dev/md0
# Stripe cache
echo 32768 > /sys/block/md0/md/stripe_cache_size
# Disable NCQ
echo 1 > /sys/block/sda/device/queue_depth
echo 1 > /sys/block/sdb/device/queue_depth
echo 1 > /sys/block/sdc/device/queue_depth
echo 1 > /sys/block/sdd/device/queue_depth
# Deadline scheduler can help with multi-threaded work loads
echo 'deadline' > /sys/block/sda/queue/scheduler
echo 'deadline' > /sys/block/sdb/queue/scheduler
echo 'deadline' > /sys/block/sdc/queue/scheduler
echo 'deadline' > /sys/block/sdd/queue/scheduler

Before: 79 MB/s writes
After: 179 MB/s writes

That’s a big improvement!