GIT – The main goals of using redundant arrays of inexpensive disks (RAID) are to improve disk data performance and provide data redundancy.
It is no secret that I am a pretty big fan of excellent Linux Software RAID. Creating, assembling and rebuilding small array is fine. But, things started to get nasty when you try to rebuild or resync large size array. You may get frustrated when you see it is going to take 22 hours to rebuild the array. You can always increase RAID resync performance using the following technique.
Recently, I build a small NAS server running Linux for one my client with 5 x 2TB disks in RAID 6 configuration for all in one backup server for Mac OS X and Windows XP/Vista clients computers. Then whey I cat /proc/mdstat it reported that md0 is created and resync is in progress. The resync speed was around 4000K/sec and resync will complete in approximately in 22 hours. I wanted to finish this early.
The /proc/sys/dev/raid/speed_limit_min is config file that reflects the current “goal” rebuild speed for times when non-rebuild activity is current on an array. The speed is in Kibibytes per second, and is a per-device rate, not a per-array rate . The default is 1000.
The /proc/sys/dev/raid/speed_limit_max is config file that reflects the current “goal” rebuild speed for times when no non-rebuild activity is current on an array. The default is 100,000.
To see current limits, enter:
# sysctl dev.raid.speed_limit_min
# sysctl dev.raid.speed_limit_max
To increase speed, enter:
echo value > /proc/sys/dev/raid/speed_limit_min
sysctl -w dev.raid.speed_limit_min=value
In this example, set it to 50000 K/Sec, enter:
# echo 50000 > /proc/sys/dev/raid/speed_limit_min
# sysctl -w dev.raid.speed_limit_min=50000
If you want to override the defaults you could add these two lines to /etc/sysctl.conf:
dev.raid.speed_limit_min = 50000 dev.raid.speed_limit_max = 200000
Bitmaps optimize rebuild time after a crash, or after removing and re-adding a device. Turn it on by typing the following command:
# mdadm --grow --bitmap=internal /dev/md0
Once array rebuild or fully synced, disable bitmaps:
# mdadm --grow --bitmap=none /dev/md0
My speed went from 4k to 51k:
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath]
md5 : active raid1 sde2(S) sdd2(S) sdc2(S) sdb2 sda2
530048 blocks [2/2] [UU]
md0 : active raid6 sde3 sdd3 sdc3 sdb3 sda3
5855836800 blocks level 6, 64k chunk, algorithm 2 [5/5] [UUUUU]
[============>……..] resync = 61.7% (1205475036/1951945600) finish=242.9min speed=51204K/sec
- man page md and mdadm
Thảo luận bài viết tại forum : http://forum.gocit.vn/threads/howto-speed-up-linux-software-raid-building-and-re-syncing.461/