[SOLVED] Does having a cache disk limit the max file size?


Recommended Posts

Currently evaluating Unraid with the following setup:

 

Parity: 1TB

Disks: 1x 1TB, 2x 500GB, 1x 128GB (SSD)

 

I have created a share across all disks with "use cache" set to prefer (or yes). 

 

According to the docs (https://wiki.unraid.net/Cache_disk)
Min. free space specifies the minimum amount of free space that must exist on the Cache disk in order for the user share file system to create objects on the Cache disk. If there is less than this amount of free space then the object will be created on the array instead.

 

So I have that value set to 0 or 120G or 1TB but no matter what I try, I cannot upload (SMB) a file bigger then 120GB. Am I missing a point here? Should it not go directly to the array if the file is bigger then the available size on the cache disk?

 

Thanks for any information!

Edited by mattie112
Link to comment
Quote

Unraid has no way to know how large a file will become when it chooses a disk to write.

Allright, then perhaps it is Windows that alerts me that I need xx GB more.

 

So what does this sentence from the docs then mean?

If there is less than this amount of free space then the object will be created on the array instead.

 

Quote

If you expect to write a file larger than cache then don't cache the share. 

I went to share -> myshare -> use cache and set it to "NO" then clicked Apply. However I still cannot write a large file. The "free" space in the share list is also not changed. Do I need to do anything else on order to disable the cache?

Link to comment

IF you want to write a very large file to the array, you have to have enough space for that file on a single data disk in the array as Unraid will not split a file across disks.  You also have to set the Min Free Space parameter (  Shares  >>>  share-name   >>>  Share Settings   ) to make sure that it does not attempt to write the file to a disk without enough free space. 

 

Your working with such (relatively) small data drives as compared to the size of the file you are attempting to transfer requires that you do a bit of planning.  The test would a more realistic one if the data disks were (say) 8TB ones. 

Link to comment

You should set Minimum Free for each user share larger than the largest file you expect to write to the share. If a disk has less than minimum, Unraid will choose another.

 

For example, you set Minimum Free to 10GB. A disk has 11GB free, so it can be chosen. You write a 9GB file to the disk, and so it only has 2GB free after and will not be chosen again for writes to the share since it has less than minimum.

 

Another example. Minimum Free set to 10GB, disk has 15GB free, so it can be chosen. You write a 20GB file, and the disk runs out of space and the write fails.

 

Cache also has a Minimum Free setting in Global Share Settings. If cache has less than minimum, cache-yes and cache-prefer shares will overflow to the array.

Link to comment

Allright, it took some experimentation but now I understand how it works ;)

The sare has a "minimum free space" but that does NOT apply to the cache (and I assumed it did).
There is a separate global "minimum free space" setting for the cache (that in my opionion can be set quite low if not using cache for anything else).
The "prefer" moves TO the cache instead of FROM the cache (was confusing at first). So when set to "yes" it works as intended. If there is space on cache -> write there otherwise write to array.

I understand that the "minimum free space" setting might need some tweaking when using large files but I will tackle that hurdle on my final array that has different capacaty then my test-stup.

Thank you for helping me understand this!

Link to comment
3 hours ago, mattie112 said:

There is a separate global "minimum free space" setting for the cache (that in my opionion can be set quite low if not using cache for anything else).
... So when set to "yes" it works as intended. If there is space on cache -> write there otherwise write to array.

You might want to reconsider your opinion.

 

If cache has less than minimum when it chooses a disk to write for a cached share, then it will choose to write to the array instead.

 

If cache has more than minimum when it chooses a disk to write for a cached share, then it will choose cache.

 

The choosing is done before the writing of the file begins.

 

If you set cache minimum "quite low", and cache has more free than that "quite low" minimum, then it won't overflow, it will choose cache. And if the file you are trying to cache is larger than remaining free on cache the write will fail.

 

You should set Minimum Free for cache to larger than the largest file you expect to cache.

Link to comment
1 hour ago, trurl said:

If you set cache minimum "quite low", and cache has more free than that "quite low" minimum, then it won't overflow, it will choose cache. And if the file you are trying to cache is larger than remaining free on cache the write will fail.

 

You should set Minimum Free for cache to larger than the largest file you expect to cache.

This can be a 'catch 22' situation if the Max Size file is a large percentage of the size of the cache drive.  As an extreme example, if you have a 128GB cache drive using it to cache a share and the largest file that you intend to write to a share is 120GB and you set the min space to 120GB, you will only be able to write a very few files to the cache before the free space is less then the minimum. You might as well be writing directly to the array because that is what will quickly end up happening.

 

What should be realized is that a bit of intelligence has to be used when designing a server setup.  If you are going to dealing with very large size files (Say, anything beyond 50GB), you have to make sure you cache drive is sized appropriately.  Off the top of my head, I would say that cache drive size should be such the the Min Free Space parameter could be set to no more than about 10% of the cache drive capacity. 

 

By the same line of thinking, if you have large qualities of data that you want to transfer to the server using the cache drive at regular intervals, you have to make sure that the cache drive is big enough to be able to accept all of it before the Mover has had a chance to get off onto the array.   

Link to comment

Good point thank you for the addition. I am not planning on writing very large files (other than initially and perhaps occasionally) so the 120GB seems fine. But I think this might be a bit of a trial to see what settings suit me best :) (for example backup from a remote location is limited anyway by the upload speed so that won't matter)

Link to comment
35 minutes ago, Frank1940 said:

By the same line of thinking, if you have large qualities of data that you want to transfer to the server using the cache drive at regular intervals, you have to make sure that the cache drive is big enough to be able to accept all of it before the Mover has had a chance to get off onto the array.   

And if you are still transferring to a cached share while mover is trying to move then things can really go off the rails. Mover is intended for idle time. There is no way to move from cache to the slower array as fast as you can write to cache, and trying to move more frequently won't help anything if you are still writing. It will just be more competition for the same disks. Better to not cache at all when transferring large quantities of data unless cache has the capacity to take all of that data.

Link to comment
18 minutes ago, mattie112 said:

Yes, I think I will disable the cache when doing the initial move of all my files :)

That is what I always recommend. Some even go so far as to not assign parity until after the initial data load, since parity updates make writes to the array somewhat slower.

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.