With the QNAP Web configurator, it’s easy to change the (re)syncing priorities from low, to medium or high priorities. But what does it mean? These settings affect the resync speed min and (possibly) max values. You can consider in the case of QNAP that only the min speed is changed. To increase the priority, it increases the min speed by following this table:
|low (service first)||medium (default)||high (resync first)|
The values are in KB/s. What happens when you set the high priority? It can be very difficult to return to the QNAP Web configurator. In this table you can see that the min value is set to 500 MB/s. It means that it tries to use as much as possible the hardware. I experienced these settings and it’s good only for a QNAP which is not used in production. So, maybe in this case we can use the default settings in production and everything would be fine. Sometimes it’s right, and sometimes it’s a problem too because the max value is always very high and it’s possible that in production you want the NAS to be more reactive.
In this article, you will learn how to change these settings without the QNAP Web configurator while the resyncing is already performing.
I consider that you know SSH and you have activated SSH on the QNAP. If it’s not the case, it’s the first thing to do.
rootaccount, QNAP uses
adminfor all the operations. Even if the QNAP is very busy, it’s (in my experiences) always possible to reach the console management via SSH.
Once you are connected, a menu appears and looks like:
+----------------------------------------------------------------+ | Console Management - Main menu | | | | 1: Show network settings | | 2: System event logs | | 3: Reset to factory default (password required) | | 4: Activate/ deactivate a license | | 5: App management | | 6: Reboot in Rescue mode (w/o configured disk) | | 7: Reboot in Maintenance Mode | | Q: Quit (return to normal shell environment) | +----------------------------------------------------------------+
q keystroke because we want to go to the normal shell environment.
Now that we have an admin prompt, what about the RAID? You can easily dump the
status via the
/proc virtual filesystem.
[~] # cat /proc/mdstat Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] md1 : active raid6 sdh3 sdg3 sde3 sda3 sdf3 sdd3 sdc3 87841850880 blocks super 1.0 level 6, 512k chunk, algorithm 2 [7/7] [UUUUUUU] [=========>...........] resync = 45.5% (8009035776/17568370176) finish=3791.9min speed=76015K/sec md322 : active raid1 sdh5(S) sdg5(S) sde5 sda5(S) sdf5 sdd5(S) sdc5(S) 7235136 blocks super 1.0 [2/2] [UU] bitmap: 0/1 pages [0KB], 65536KB chunk md256 : active raid1 sdh2(S) sdg2(S) sde2 sda2(S) sdf2 sdd2(S) sdc2(S) 530112 blocks super 1.0 [2/2] [UU] bitmap: 0/1 pages [0KB], 65536KB chunk md13 : active raid1 sdh4 sdg4 sde4 sda4 sdf4 sdd4 sdc4 458880 blocks super 1.0 [24/7] [UUUUUUU_________________] bitmap: 1/1 pages [4KB], 65536KB chunk md9 : active raid1 sdh1 sdg1 sde1 sda1 sdf1 sdd1 sdc1 530048 blocks super 1.0 [24/7] [UUUUUUU_________________] bitmap: 1/1 pages [4KB], 65536KB chunk
In this dump, we see that it’s
md1 which is resyncing with a current speed of
76 MB/s. Of course, the min value is set to 500 MB/s (we have set the high
priority), then the resync follows this limit. The hardware is limited mostly by
the magnetic harddisk capabilities and 76 MB/s seems to be the best possible
Just do it:
[~] # cat /sys/block/md1/md/sync_speed_min 500000 (local)
You can look the max speed is you want, just with
sync_speed_max instead of
sync_speed_min. Here it’s the current speed limit for this device only.
Reduce the min speed, and the Web GUI will works again. Because on Linux/Unix everything is file, just write the new limit for this device in order to drive the device.
echo 1000 > /sys/block/md1/md/sync_speed_min
This action is immediat, the minimal speed will be set to 1 MB/s. Now you can
use the QNAP Web configurator as usual. Use
cat /proc/mdstat in order to
verify that the speed is changing.
Here we have not changed the max limit, then the speed can still be high if the QNAP is mostly “idle” for other operations.
Please wait, it’s not finished. Of course, the system seems more usable but if your QNAP is used in production, it can still be a problem even with the low priority. The main reason is the max value which is always set to 500 MB/s. It’s very high and it means that the speed can be very low but very high too. In our case we have a virtual machine harddisk directly mounted via NFS. This virtual harddisk must be reachable everytime for the virtual machine. It’s not acceptable to have a max of 500 MB/s for the RAID resyncing. The solution is very simple, of course the resyncing will be longer (it’s not magic).
echo 20000 > /sys/block/md1/md/sync_speed_max
Now the max speed is limited to 20 MB/s. We are sure, that the RAID will be all the time between 1 MB/s and 20 MB/s. We can imagine to use a CRON job in order to change the value according to the daylight. Maybe the night we want more speed because the system is less stressed.