[Plugin] Mover Tuning


Recommended Posts

1 hour ago, hugenbdd said:

Bug fix release just now. (5/11/2020)

 

Added ability for spaces in share names (quotes around share path) and fixed spelling mistake.

 

Glad I could contribute a little and thanks for a great plugin.

 

All was well with my cache until I added time machine - now my once-sleepy parity disk (and every other disk thanks to turbo write) never rest. Mover Tuner has helped greatly but I'm thinking for my purposes (media and Time Machine) a cache that stays relatively full and evicts based on last access date would be ideal. I'll research to see if that's even possible and how difficult it would be and maybe write something.

Link to comment
6 hours ago, CS01-HS said:

 

Glad I could contribute a little and thanks for a great plugin.

 

All was well with my cache until I added time machine - now my once-sleepy parity disk (and every other disk thanks to turbo write) never rest. Mover Tuner has helped greatly but I'm thinking for my purposes (media and Time Machine) a cache that stays relatively full and evicts based on last access date would be ideal. I'll research to see if that's even possible and how difficult it would be and maybe write something.

Let us know if you find a way for last accessed.  Shares are mounted with atime excluded... Which means it's not kept on the file.  (look a few pages back for discussion.)  As I would love to modify it for that ability,  so that cache can act as a "read" cache also.  Closer to tiered storage.

Link to comment

I'm all caught up on the thread. Just thinking out loud but maybe an easier method that gets most of the benefits is to use last-modified (as you do in the age setting) and when a user-specified target cache % is exceeded iterated find commands (which should be cheap on an SSD) slice off the oldest files until the target % is restored.

Edited by CS01-HS
Link to comment

I have thought about this....

 

Would all options be used?

If so, what if the options used, don't allow us to reach free space desired?

If not, what options should be used if any?

 

Do we add 1 file per share to a "total files to move" file list until we get to the desired free space?  (I haven't testing sending in a mixed file list to the binary mover, but I think it will work with no problems.)

 

Or..

Is this just - move old files over until % free?  so if you choose this option, all others are ignored or grayed out in the scheduler screen?

What would the inputs be for % free?  90-10%

 

Link to comment

Same. Tell me if this makes sense:

 

In "target mode" there are two basic conditions to handle:

(1) a large cache write

(2) many small or medium cache writes

 

Case (1) has the potential to fill the drive if a high target (say 75%) is specified, so mover must run frequently enough to detect it and free cache space.

 

With frequent mover runs, assuming the age logic is granular (find sorted by age and iterate the files summing size), case (2) will cause very frequent array writes as a handful of files are moved on each run to maintain the target %. Better then to move the old files off in larger chunks, time rounded to the day (e.g. first all files older than 30 days from current date at 12am, then all older than 29, etc.)

 

That was all preface (sorry!) to answer your question:

 

I think it's almost entirely a UI decision. You could handle a target % and complex rules in code by calling your current rules logic in a loop from e.g. i=30 down, find older than i days until target free space is reached. And if it fails to free enough space that's on the user.

 

Your "Or..." which is my preference (your range is good), would be similar but skip over the complex rules logic avoiding failures due to user error.

 

Both proposals are a little hack-y (maybe you have a better idea) but I think until smart caching's built in every solution will be somewhat hack-y. 


I really appreciate this exchange but please don't let me derail what's obviously a popular plugin to handle my (potentially minority) use case.

Link to comment
On 3/25/2020 at 1:28 AM, guythnick said:

Yes, I think should be independent of the age option, but both can be used.

Under 3MB seems to capture all the images and subtitle files that I want to keep on the cache.

 

If it is piping into the find command, I believe you really only need to add one switch to the command when the option is selected:

 

-size +x

where x would be the integer in megabytes.

Hello @guythnick and @hugenbdd I also though of this but I tough one thing at a time.
 

Option 1

This is the change I was thinking removing yes and adding in bigger  and smaller as the on options which change the functionality of the size in the next line.

image.png.402225dd86a730f288f925ebb7b9d640.png

 

 

Option 2

 

The option that has just been introduced to filter files on extension

image.png

would also solve this same issue if it was ONLY used in relation to your locations you stipulate in the path skiplist.txt file, however this is not the case as the extension option covers all files with specified extension across the ENTIRE cache.

 

 

On a side note:

@hugenbdd I also tested your sparseness option using ( Create Sparse File ) however it did not seem to pick it up for movement, however I may be testing incorrectly I'm not sure.

 

 

 

Edited by IronBeardKnight
double image deleted one
Link to comment

A Small Guide

 

For those that want to use the new features but are a little lost or perhaps this will save you some time.
 

 

 

Open Unraid CMD.

    cd /boot/config/plugins/ca.mover.tuning

    sudo nano skiplist.txt

 

In the nano editor you can list your locations to skip like the following:

image.png.7244f4c9f55bfa2d7d4bab2f055b0fc0.png 

 

   Ctl + o 

   Ctl +x

 

Note: The list of locations may include or not include /mnt/cache/ as this is already catered for withing the mover script

 

Find Specific files of a name or kind you may find for example all .png in a location  and then put them in your exclusion list incase they are mixed in with other files and such example below.


  find "/mnt/cache" -type f \( -name "*.png"\) -print


Open CA Mover Tuning GUI

In CA Mover Tuning Plugin Set the location of your skiplist.txt as below

    File list path: /boot/config/plugins/ca.mover.tuning/skiplist.txt


image.thumb.png.b25b7d3f362ec74b73d1286ca274125d.png

Edited by IronBeardKnight
  • Like 1
Link to comment
3 hours ago, CS01-HS said:

Same. Tell me if this makes sense:

 

In "target mode" there are two basic conditions to handle:

(1) a large cache write

(2) many small or medium cache writes

 

Case (1) has the potential to fill the drive if a high target (say 75%) is specified, so mover must run frequently enough to detect it and free cache space.

 

With frequent mover runs, assuming the age logic is granular (find sorted by age and iterate the files summing size), case (2) will cause very frequent array writes as a handful of files are moved on each run to maintain the target %. Better then to move the old files off in larger chunks, time rounded to the day (e.g. first all files older than 30 days from current date at 12am, then all older than 29, etc.)

 

That was all preface (sorry!) to answer your question:

 

I think it's almost entirely a UI decision. You could handle a target % and complex rules in code by calling your current rules logic in a loop from e.g. i=30 down, find older than i days until target free space is reached. And if it fails to free enough space that's on the user.

 

Your "Or..." which is my preference (your range is good), would be similar but skip over the complex rules logic avoiding failures due to user error.

 

Both proposals are a little hack-y (maybe you have a better idea) but I think until smart caching's built in every solution will be somewhat hack-y. 


I really appreciate this exchange but please don't let me derail what's obviously a popular plugin to handle my (potentially minority) use case.

At this point I think I would rather write code that does the "or"... i.e. move to free space and move aging files off without regard to any other settings.  Will be easier to code at this time.  But,,, I would like some time to think about this and how I would go about doing it.

 

One thing to keep in mind...  Currently mover run's based on the scheduler options.  So "hourly".  You could create your own cron job though to make it more often.

Link to comment
2 hours ago, IronBeardKnight said:

Hello @guythnick and @hugenbdd I also though of this but I tough one thing at a time.
 

Option 1

This is the change I was thinking removing yes and adding in bigger  and smaller as the on options which change the functionality of the size in the next line.

image.png.402225dd86a730f288f925ebb7b9d640.png

 

 

Option 2

 

The option that has just been introduced to filter files on extension

image.png

would also solve this same issue if it was ONLY used in relation to your locations you stipulate in the path skiplist.txt file, however this is not the case as the extension option covers all files with specified extension across the ENTIRE cache.

 

 

On a side note:

@hugenbdd I also tested your sparseness option using ( Create Sparse File ) however it did not seem to pick it up for movement, however I may be testing incorrectly I'm not sure.

 

 

 

Thanks for the sparse file link.   I will be able to test/recreate now.  I created the find script based on a post a page or so back, but wasn't really sure how to test it.

 

Option 1: This should be possible and a smaller change overall.

Option 2: Sounds like you want options applied per share.  I'm not ready to change the code so it supports different settings for different shares.  There is a LOT of work there...

Link to comment
9 hours ago, hugenbdd said:

Thanks for the sparse file link.   I will be able to test/recreate now.  I created the find script based on a post a page or so back, but wasn't really sure how to test it.

 

Option 1: This should be possible and a smaller change overall.

Option 2: Sounds like you want options applied per share.  I'm not ready to change the code so it supports different settings for different shares.  There is a LOT of work there...

Hey Mate, :) yeah just suggestions I think option one would also be the easiest as well. The second option was is such a rare case situation that it can be stored in the archive for later use if you ever need or there is demand for it later maybe.

 

Oh also I think the spelling mistake may still be there fyi as I could see it even after updating the plugin.

 

Hint For The Masses:

We need keep  in mind that exclusion file  types or locations should always come before criteria to move  based on ages/ last accessed/ space or what ever else as exclusions are for sub-directories and/or files that need to stay in cache no matter what other options you have selected.

 

Personally these new features have sped up my nextcloud instance alone exponentially and I'm looking to do some testing with game load time as well in future.

 

Thank you again to @hugenbdd for doing all the ground work.

 

 

Link to comment
36 minutes ago, IronBeardKnight said:

Hey Mate, :) yeah just suggestions I think option one would also be the easiest as well. The second option was is such a rare case situation that it can be stored in the archive for later use if you ever need or there is demand for it later maybe.

 

Oh also I think the spelling mistake may still be there fyi as I could see it even after updating the plugin.

 

 

 

 

Yup, spelling mistake still there.  I'll hold off on a release just for it though.

 

Next release won't be until I can test spareness and add the "smaller/large" request around size.

  • Like 1
Link to comment
  • 2 weeks later...

Does this still work?

 

No matter what I do, mover absolutely kills my machine, every core showing red on the dashboard. tried changing priority’s and it makes no difference.

 

Mover has just started and now I can’t play anything on Emby because it’s killed the computer.

 

I’m sure this plugin used to help, but I just can’t seem to change anything in it that helps.

Link to comment
On 5/22/2020 at 3:01 PM, Fizzyade said:

Does this still work?

 

No matter what I do, mover absolutely kills my machine, every core showing red on the dashboard. tried changing priority’s and it makes no difference.

 

Mover has just started and now I can’t play anything on Emby because it’s killed the computer.

 

I’m sure this plugin used to help, but I just can’t seem to change anything in it that helps.

I didn't modify any of the previous part of the script around setting the performance...

 

Can you post a screen shot of your settings and maybe the log entry for mover and I can review my code.

Link to comment
On 5/23/2020 at 9:17 PM, hugenbdd said:

I didn't modify any of the previous part of the script around setting the performance...

 

Can you post a screen shot of your settings and maybe the log entry for mover and I can review my code.

I'll do that now.  The mover is actually doing my head in, so much so that I'm contemplating removing the cache drives because my machine absolutely tanks when it runs.

 

I'm sure at one point I had this plugin working to solve the issue, but I just can't seem to get it to work, the mover runs and until it's finished I can't play any movies from Emby.  I was so happy when I found this plugin.

Link to comment

Here's a screenshot of the mover tuning settings.  I looked in the syslog file and couldn't see any mover entries.

 

Thanks for your response, I know this isn't your issue. it's the mover, it shouldn't kill a 16 core machine though, even if IO bound I would have expected setting the priority low that everything else would take priority.

 

131556198_CleanShot2020-05-26at16_54.49@2x.thumb.png.611f6fa4ff2df8ce3885657cc7bdc0b9.png

Link to comment

Agree with Alturismo     Disable Turbo. 

 

It also looks like you are not using the latest updated plug in.  If you can't "update", you may have to uninstall and then look for the new one with my username after Squid's.  The author should be "Andrew Zawadzki Modified by hugenbdd"

Link to comment
16 hours ago, hugenbdd said:

Agree with Alturismo     Disable Turbo. 

 

It also looks like you are not using the latest updated plug in.  If you can't "update", you may have to uninstall and then look for the new one with my username after Squid's.  The author should be "Andrew Zawadzki Modified by hugenbdd"

I had actually only turned that on a few hours before I posted the screenshot just as something else to try, it’s been running disabled forever.

 

ive just updated the plugin (to the correct one) enabled logging and redisabled turbo write.

Link to comment
1 hour ago, Fizzyade said:

I had actually only turned that on a few hours before I posted the screenshot just as something else to try, it’s been running disabled forever.

 

ive just updated the plugin (to the correct one) enabled logging and redisabled turbo write.

You may want to enable logging.  Then check /var/log/syslog for an entry similar to this.

May 27 01:05:01 Tower root: Starting Mover
May 27 01:05:01 Tower root: ionice -c 2 -n 0 nice -n 0 /usr/local/emhttp/plugins/ca.mover.tuning/age_mover start 30 0 0 '' ''
May 27 01:05:01 Tower root: mover: started

 

(Note: I do not have the priorities set to low, just "normal" so the values for ionice and nice will be different than yours.)

 

Link to comment

hmm if its munching cpu hard is it trying to move something that is actually running like vm's or docker containers or anything. cpu would spike hard if you where to try move something that is actively processing data. you may also have downloads trying to feed your cache i you have set it up that way and when the mover runs its trying to move active files ?

What are your share settings per share that use the cache?

 

There are many possibilities here and given to the amount of variables that can be associated with using cache and thus the mover its just a process of narrowing things down one at a time. 

Its possible if you have an overclock as well that bclk if modified is too high causing further instability on other system device e,g sata/sas drives, pcie lanes which could have adverse affects. 

 

I know its a pain but stock everything except your raid itself and go one by one if all else fails.

 

I'm not having a go just trying to be helpful as much as I can :), Please let us know how you go.

Link to comment
  • 3 weeks later...

So it all went wonky again last night, every CPU pegged to 100%, system unresponsive, in the end I had to reboot it, of course that meant I lost the logs.

 

There was only my media folder using the cache, the actual downloads were not cached.  No overclocking.

 

I just stopped docker & vm's, ran mover and then disabled the couple of shares that were using cache, then removed the cache drive.

 

 

 

 

Link to comment

Right, I’m ready to give the mover another go.

 

the only thing I’m interested in using it for is my downloads.

 

are there any dos, do nots.  Any sane settings I should start with.

 

is it possible to set the mover logging to log to the array, so that if I end up having to restart the server due to the mover, I can produce a log file?

 

thanks.

Link to comment
6 minutes ago, Fizzyade said:

Right, I’m ready to give the mover another go.

 

the only thing I’m interested in using it for is my downloads.

 

are there any dos, do nots.  Any sane settings I should start with.

 

is it possible to set the mover logging to log to the array, so that if I end up having to restart the server due to the mover, I can produce a log file?

 

thanks.

Start with the stock mover and see if you can move 20-40GB of data off the cache first without it locking up your system.  Make sure logging is enabled.

 

I do not have a separate logging file.

 

After you have confirmed it doesn't lock your system up with the stock mover, then install the plugin and just start off with one or two settings.

Link to comment
2 hours ago, hugenbdd said:

Start with the stock mover and see if you can move 20-40GB of data off the cache first without it locking up your system.  Make sure logging is enabled.

 

I do not have a separate logging file.

 

After you have confirmed it doesn't lock your system up with the stock mover, then install the plugin and just start off with one or two settings.

it doesn’t, the reason I initially installed mover tuner is because the mover pegs the processor.

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.