Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»RAID-ARRAY»How to Increase Speed of Software RAID Rebuilding in Linux

    How to Increase Speed of Software RAID Rebuilding in Linux

    By RahulMarch 10, 20233 Mins Read

    While we are learning about RAID devices, Generally we used smaller disks to build a RAID array. In that time when any raid disk failed and we replaced it with a new disk. Then raid rebuilding takes a few minutes or seconds only. But think about if you are running a high storage capacity server or any backup drives which are having raid configured in size of multiple terabytes and you need to rebuild RAID 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.

    Advertisement

    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 kernel 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 command.

    # 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

    raid Software RAID
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    What is RAID Storage Technology

    How to Replace Faulty Device from RAID Array

    How to Setup RAID-1 Array using Two Virtual Disks in CentOS/RHEL 6

    View 2 Comments

    2 Comments

    1. Tyrone S. on March 9, 2023 4:00 pm

      The command to increase the rebuild speed misses a “>”.

      Reply
      • Rahul on March 10, 2023 4:30 am

        Thanks Tyrone

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Configure Postfix to Use Gmail SMTP on Ubuntu & Debian
    • PHP Arrays: A Beginner’s Guide
    • Deploying Flask Application on Ubuntu (Apache+WSGI)
    • OpenSSL: Working with SSL Certificates, Private Keys and CSRs
    • How to Create and Read List in Python
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.