Improved (more precise) Incremental Parity Check


Recommended Posts

I've been running Unraid for a few years now, but haven't been running scheduled parity checks because of the time it would take to complete them.  Then I found out about the tuning plugin which allows it to run for certain times of the day and then suspend the process.  This sounded great and indeed I have started using it. 

 

However its not ideal.  It checks however much of the disk it can check in the time window allowed.  If it doesn't finish the whole check by the next time it is scheduled to run it starts over from the beginning so the end of the array may not be checked.  If it finishes before there may be days it doesn't check anything.  Also if the system is shut down it won't start the check again for awhile (unless I change the start date to the next day, which means it would start the check over from the start).

 

I would like to propose a more robust/precise solution to incremental parity checks.  Something where I could set the parity check to run daily.  Then I could specify the number of chunks to spread the check over.  One of the chunks would be checked every day.  Could be modulus of the days since epoch.  So for example.  Lets say I wanted to check the entire array every 2 weeks.  I schedule start to daily.  Set my start time.  Set my number of chunks to 14.  There are currently 738900 days since epoch.  738900 mod 14 = 8 so chunk #8 would be checked today.  Tomorrow it would do chunk 9.

 

I do realize the parity checker itself would have to be changed to be told what part of the array to check whereas the tuning plugin uses the existing one so this suggestion would be more difficult to implement.  I just like the idea of a precise equal part of the array being checked everyday and it can continue the check the next day without starting again from the beginning and not wait til the next weekly/monthly start if the computer happens to be shut down for a day.

Link to comment
19 minutes ago, Jeff Adams said:

However its not ideal.  It checks however much of the disk it can check in the time window allowed.  If it doesn't finish the whole check by the next time it is scheduled to run it starts over from the beginning so the end of the array may not be checked.  If it finishes before there may be days it doesn't check anything.  Also if the system is shut down it won't start the check again for awhile (unless I change the start date to the next day, which means it would start the check over from the start).

Are you sure you are talking about the Parity Check Tuning plugin because:

  • The plugin does not restart from the beginning for each increment.   It continues from the point already reached when starting the next increment.  This is repeated until the whole parity drive has bedn checked.   
  • The plugin has an option to restart from the point last reached after a reboot (as long as the shutdown as a tidy one).   This caters for those who want to shutdown their server overnight or those who have regular power cuts (as long as they have a UPS so that the clean shutdown can be achieved).

iI looked into using size increments instead of time ones but although technically possible this proved not that useful in practice since the speed can be affected by many factors so the time for a given percentage of the parity drive could vary significantly.  Time based increments proved far more practical and it is easy enough for users to work out how many increments a full check takes if they run a similar length increment each day.

  • Upvote 1
Link to comment
29 minutes ago, Jeff Adams said:

30 minutes daily checking the array in the middle of the night

Your nights are only 30 minutes long?

 

Even without the plugin, latest releases do incremental parity checks. Mine run monthly, 12am-6am, and is finished partway through the 3rd night of the month..

Link to comment
3 hours ago, itimpi said:

The plugin does not restart from the beginning for each increment.

The issue is OP is doing way too frequent checks so there's a new one scheduled before the previous is done.

 

4 hours ago, Jeff Adams said:

I would rather it spend 30 minutes daily checking the array in the middle of the night, than 12+ hours once a month and impact anything I'm trying to do on that one day.

If you schedule a check every 1-2 months like is usual then even with 30 mins a night you'll have ample time for it to finish before a new one is scheduled. 

There is no point constantly checking, you're just adding wear to your drives for nothing.

Edited by Kilrah
Link to comment
  • 7 months later...
On 1/15/2023 at 4:54 PM, Kilrah said:

The issue is OP is doing way too frequent checks so there's a new one scheduled before the previous is done.

 

If you schedule a check every 1-2 months like is usual then even with 30 mins a night you'll have ample time for it to finish before a new one is scheduled. 

There is no point constantly checking, you're just adding wear to your drives for nothing.

lets do some math shall we?  parity check on 10tb drives, 8 of them, 2 parity 6 data.  takes around 1 to 1.5 days.   lets add in a little interference like say syncthing and plex competing for some drive time and it's closer to 2 days, sometimes more.   so for simplicity we'll just say 1.5 days.  that's 36 hours.   36 hours divided into 30 minute segments,  that's 36*2.  that's 72 30 minute segments.   so best case it would take 72 days to do a parity check doing 30 minute segments a night.   please revisit your thinking on your 1-2 month claim.  yes I'm sure some have faster rigs that can finish this quicker than mine, but mine ain't too bad so I don't see anyone getting too much improvement on speed here. As stated by others in the group, unless your rig is using much smaller hard drives, or you're using ssd's or some other setup that's faster than 8 spinning rust drives each hooked on dedicated lanes, then your system will be scheduling another parity check before first finishes and restarting.  a common mistake in the plugin is at the top of the page, setting your parity check to daily.  don't do that.  this setting has nothing to do with the automatic pausing and resuming each day.  Please set it to monthly or more.

 

I suggest you leave the plugin at its default of what was it? 3 hours of checking a night?  much more reasonable and still shouldn't bother you since it's happening while you sleep anyway.  it stops around 3:30 by default because the mover is scheduled by default to start at 3:45am so it's trying to make sure mover doesn't have to compete with parity checking for hard drive access.  If you need more time, then set it to start before midnight and leave ending where it's at already.  This should work I believe, unless it was badly coded and fails the date calculation to determine your intent is to start before midnight and end after.

 

my times might be off a little, if so feel free to correct me anybody.  Sleep deprivation will do that to you.  I'm running on 2 weeks with about 20 hours of sleep total the entire 2 weeks.

Link to comment

oh and for the curious, my build isn't anything super fancy.  8 10tb drives in a diy nas enclosure.  just a basic mini atx server board who's only redeeming qualities is 8 independent channel sata ports and 2 nvme slots on the board. an 8x psi express slot and a 16x slot. 128 gigs ecc memory.  3.6ghz xeon processor. 1 tb nvme cache.  planning to add a good video card for hardware transcoding but haven't decided on what to use yet.  Don't need anything super powerful as even a cheapo can handle hardware transcoding at reasonably good speeds.  it does take average of 1.5 to 2 days, sometimes a little more, for a parity rebuild.  if I shut off all other services I can get it down to about a day.

Link to comment
6 hours ago, recalcitrant-salary1520 said:

I suggest you leave the plugin at its default of what was it? 3 hours of checking a night?  much more reasonable and still shouldn't bother you since it's happening while you sleep anyway.  it stops around 3:30 by default because the mover is scheduled by default to start at 3:45am so it's trying to make sure mover doesn't have to compete with parity checking for hard drive access.  If you need more time, then set it to start before midnight and leave ending where it's at already.  

 

I am ging to change the default pause setting for increments to be 7:30 instead of the current 3:30.   The options to temporarily pause while move or a backup are running seem to now be working as expected which means it is no longer so relevant to not allow the parity check increment time to overlap their running times.

 

6 hours ago, recalcitrant-salary1520 said:

This should work I believe, unless it was badly coded and fails the date calculation to determine your intent is to start before midnight and end after.

 

This is allowed for.   It is not unusual for users to start late in the evening but before midnight.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.