While we are learning about devices, Generally we used smaller to build a array. In that time when any failed and we replaced it with a new . Then rebuilding takes a few minutes or seconds only. But think about if you are running a high storage capacity or any backup drives which are having configured in size of multiple terabytes and you need to rebuild or rebuilding started due to some issues. It takes a lot of time and we run keep running `cat /proc/mdstat` time to time for checking the status.

Now what to do, How can we speed up raid reconstruction speed. This can be done with various ways. But I generally used below method by changes parameter. Follow the below steps

Check Current Recovery Speed and Status

One of servers managed by me raid disk failed, So we replaced it with another disk and configured. RAID rebuilding speed was very slow As you can view below output.

# cat /proc/mdstat 
Personalities : [raid1] 
md1 : active raid1 sdb2[0] sda2[1]
      4193216 blocks [2/2] [UU]
      
md2 : active raid1 sdb3[0] sda3[1]
      968372864 blocks [2/2] [UU]
      [=====>......] check = 48.5% (470179584/968372864) finish=7698.8min speed=1078K/sec
      
md0 : active raid1 sdb1[0] sda1[1]
      4193216 blocks [2/2] [UU]
      resync=DELAYED
      
unused devices: <none>

Now I checked the kernel parameter configured for minimum and maximum raid rebuild speed using below .

# cat /proc/sys/dev/raid/speed_limit_max 
200000

# cat /proc/sys/dev/raid/speed_limit_min
1000

As per above output i found that raid reconstruction speed is set minimum to 1000 KB/Sec/Disc and Maximum to 200000 KB/Sec/Disc.

Increase Minimum RAID Recovery Speed

As we can see that Maximum speed looks fine, but minimum speed is low, Which we need to increase. Before setting any speed make sure that you are enough CPU and RAM resources. Changes may also affect your other application’s speed running on same server.

To set minimum speed to approx 20MB/sec use following command.

# echo "20000" /proc/sys/dev/raid/speed_limit_min

Check Again RAID Recover Speed and Status

After making above changes, let’s check raid reconstruction speed again using same command. Now as per below command output speed is better 3426K/sec then earlier.

# cat /proc/mdstat 
Personalities : [raid1] 
md1 : active raid1 sdb2[0] sda2[1]
      4193216 blocks [2/2] [UU]
      
md2 : active raid1 sdb3[0] sda3[1]
      968372864 blocks [2/2] [UU]
      [=====>......] check = 48.6% (470793472/968372864) finish=2419.7min speed=3426K/sec
      
md0 : active raid1 sdb1[0] sda1[1]
      4193216 blocks [2/2] [UU]
      resync=DELAYED
      
unused devices: <none>

Read more about raid devices http://en.wikipedia.org/wiki/RAID

Print Friendly

Comments

comments

Bài viết liên quan