How to increase the RAID rebuilding speed ?

0

Hi! fellow sysadmins, In the world of data storage, RAID (Redundant Array of Independent Disks) plays a pivotal role in ensuring data integrity and system reliability. One of the critical aspects of maintaining a healthy RAID array is the rebuilding process after a disk failure. In this blog, we'll explore a technique to boost the speed of RAID rebuilding.

When a disk fails in a RAID array, the system initiates a rebuilding process to restore redundancy and data integrity. However, the default settings for RAID rebuilding might not always align with the urgency or specific requirements of your system. Enter the /proc/sys/dev/raid/ kernel variables - your key to unlocking unparalleled control over the rebuilding speed.


Understanding the Variables

The /proc/sys/dev/raid/speed_limit_min and /proc/sys/dev/raid/speed_limit_max kernel variables act as the leader for controlling the rebuild speed. These variables play a major role in determining the rebuild speed during non-rebuild and no non-rebuild activity periods, respectively. Understanding and manipulating these variables can significantly enhance the RAID rebuilding process.


Checking the Current Limits

Before making any adjustments, it's essential to know your system's current limits. You can do this by executing a following commands:

sysctl dev.raid.speed_limit_min

sysctl dev.raid.speed_limit_max

** Above commands reveal the current minimum and maximum rebuild speeds in Kibibytes per second (KiB/s).


Let's check my current speed using following command in QNAP:

cat /proc/mdstat


It's important to note that these tweaks might lead to increased system load, including higher CPU and memory usage. Therefore, please do these adjustments carefully, considering your system's overall capacity.



Way 1:

echo 50000 > /proc/sys/dev/raid/speed_limit_min


Way 2: 

sysctl -w dev.raid.speed_limit_min=50000


Way 3: 

Permanent Changes with /etc/sysctl.conf

If you wish to make these changes permanent, add the following lines to the /etc/sysctl.conf file:


# Override default minimum rebuild speed

dev.raid.speed_limit_min = 50000

# Adjust maximum rebuild speed based on the array size

# For 4-5 disks based array

dev.raid.speed_limit_max = 2000000

# For large 6-12 disks based array

dev.raid.speed_limit_max = 5000000


Post a Comment

0Comments
Post a Comment (0)