emscom > emscom Help Desk > Knowledgebase

Search help:

Linux MD RAID optimisation


1. report raid rebuild status

cat /proc/mdstat

watch -n1 cat /proc/mdstat


2. raid speed limits.  Increases CPU and RAM utilisation

#report current speed limits




#set speed limits (runtime only default values)

sysctl -w

sysctl -w


#set speed limits at boot by editing /etc/sysctl.conf

# for 3 disk array

# for 4-5 disk array

#uncomment for 6-12 disk array


3. disable NCQ on raid members

#read current NCQ depth (default 32)

cat /sys/block/sda/device/queue_depth

#disable NCQ (runtime only)

echo 1 > /sys/block/device/queue_depth


#disable NCQ at boot, requires sysfs package to be installed

# edit /etc/sysfs.conf

#disable NCQ on raid members sda, sdb, sdd, sde






4. set raid5 stripe cache size

#ram_used = system_page_size * nr_disks * stripe_cache_size

# read current stripe_cache_size on array md0

cat /sys/block/md0/md/stripe_cache_size


#set to 16MiB (runtime only)

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


#set to 32MiB at boot

#create udev rule /etc/udev/rules.d/60-md-stripe-cache-size

SUBSYSTEM=="block", KERNEL=="md*", ACTION=="add|change", TEST=="md/stripe_cache_size", ATTR{md/stripe_cache_size}="32768"


#for Open Media Vault (OVM default 8MiB) edit /etc/udev/rules.d/99-openmediavault-md-raid-rules

SUBSYSTEM=="block", KERNEL=="md*", ACTION=="add|change", TEST=="md/stripe_cache_size", ATTR{md/stripe_cache_size}="8192"


5. Set read ahead, in 512 byte sectors

blockdev --getra /dev/md0

#set 32MB read ahead (runtime only)

blockdev --setra 65536 /dev/md0



Was this article helpful? yes / no
Related articles Linux create MD RAID5 device
Build. Align partition
Centos 7 rename ethernet interface
Article details
Article ID: 139
Category: NAS
Date added: 07-12-2020 13:49:53
Views: 20
Rating (Votes): Article not rated yet (0)

« Go back

Powered by Help Desk Software HESK, in partnership with SysAid Technologies