Backtrack:  
 
by lunarg on April 26th 2007, at 22:34

The problem

Every now and then, one might need to resync one or more disks that were in a linux software RAID array. This usually is not a problem at all, but once in a while (in particular on SATA controllers), the resync takes up a lot of system resources, regardless of the fact that the resync doesn't exclusively uses bandwidth (i.e. it only uses the free available bandwidth).
In this case it may be necessary to cap the maximum resync speed limit to a lesser value, so a bit of bandwidth becomes free again, seriously reducing the I/O load.

The solution

Changing the maximum and minimum speed limits is easy. Like most system things, this is done by echoing the desired speed to a file in the /proc filesystem:

To set the maximum speed limit:

echo "kilobytes per second" > /proc/sys/dev/raid/speed_limit_max

This sets the maximum speed limit to kilobytes/sec, so if you would have a speed of 20MB/s, you would set the number to 20480.

To set the minimum speed limit:

echo "kilobytes per second" > /proc/sys/dev/raid/speed_limit_min

This sets the minimum speed limit to kilobytes/sec, so if you would have a speed of 1MB/s, you would set the number to 1024.