Questions about the cache pool

6 posts in this topic Last Reply

Recommended Posts

I stole unRAID from an app server to create a small vSphere datastore server. I only have one disk which is enough since I only need about 1TB, when you add parity and the cache pool, that single disk alone maxes the basic license I had for the app server anyway. I'll need another one soon.


In the cache pool; I'm getting on-screen that it was created fine but it seems like it's using only one disk and the other is maybe a hot spare instead of using both. When you click on the little Cache and Cache 2 link on each drive's row only one of them show anything about being in a pool.


It says it's in RAID1, it reports the capacity of a RAID1. Which would be enough to shut me up if it wasn't for this:


The unRAID cache pool is created through a unique twist on traditional RAID 1, using a BTRFS feature that provides both the data redundancy of RAID 1 plus the capacity expansion of RAID 0.


Unless it means "…the future capacity expansion of RAID 0." As in easy to mix disks sizes and whatnot, yeah…IDK, I sort of forgot--truth is I started writing this a day or two ago and I had rationalized it perfectly by just adding the word "future". 🥳 :) It's still not so good, but my excuse of its excuse was awesome.


But now I'm skeptical as if it really both disks are working in tandem or not, because according to that last sentence it's supposed to leverage BTRFS' COW as some sort of virtual parity and report the capacity closer to RAID0 with what I think would be self-contained resiliency (if a disk fails, it doesn't take the array with it), on not too clear on that, at least that's what's understood from that.


#1 Are both disks working? Just to clarify, I'm not concerned about squeezing out every last bit of the pool, I just want to confirm if it was setup correctly or not.


#2 Does the cache pool operate on a block level fashion?

Will differences of a existing huge file, like a VMDK be written to disk or to cache? Does it have to retrieve the file and put it on cache if I want it to be faster (select prefer cache)–i.e. file level? and,

Would the cache constrain the maximum file size I can transfer to unRAID then?


#3 What happens when the cache gets full?

- Will it transparently redirect and continue writing to disk?

- Will it fail?

- [this is the one I fear the most] Will it hold transfer and queue the writes on cache while it frees enough cache space to continue the queued transfers? i.e: pause-moveOldest2disk-placeNewestOnCache-repeat … that is, if transfer don't time out.

- What if it's still a single file being worked on? (it doesn't fit in the cache)



VMDKs need fast access and are huge, even thin provisioned. There's always the chance of a bad vMotion where a file could get inflated to terabytes plus its snapshots as well. That happened to me once, it was a bug but it inflated all the snapshot the size of the main virtual disk, fortunately it was only a 128GB in size, but it had a second 60-80GB disk and about 5 snapshots, very rare on a properly maintained VM. It was not fun. 😔 Just now I'm finding out that the VMs were eager zeroed, since I have more than enough space it's not a problem but I'd like to be ready for anything just in case. That's another bug in vSphere since 6.7, I think. I'm on 7u1, still not fixed.

Edited by vitaprimo
Link to post
3 hours ago, vitaprimo said:

#1 Are both disks working? Just to clarify, I'm not concerned about squeezing out every last bit of the pool, I just want to confirm if it was setup correctly or not.

Yes, in RAID1 mode (default), max usable size is 480GB.


3 hours ago, vitaprimo said:

Will differences of a existing huge file, like a VMDK be written to disk or to cache?

An existing file can only be one cache or one of the array disks, not both, any changes to an existing file will be done where the file resides.


3 hours ago, vitaprimo said:

What happens when the cache gets full?

NEW files will be written to the array (if the use cache setting for that share and minimum free space are correctly configured), if an existing file grows beyond usable cache space it will just run out of space.

Link to post

Thanks, now that's a lot clearer. Now that the VMs are in place and I'm actually working on them I'm starting to see the bottleneck of the single spinning disk, they might use little space but there are a lot of them. I may have to scrap the cache and use several small spinning disks--or SSDs but I don't remember where I read it's not recommended--I need to look that up. :/


Thanks again!

Link to post

Nope, spoke too soon--I just swap the content with a Synology unit, it also has a cache pool but it's block level cache. It'll be much more useful for VMs.


If you're feeling generous :) one last question before making the swap though, what happens if a NEW file is bigger than the cache? Obvi the OS checks if there's enough space to save it, but an OS doesn't know about the cache. Is this passed to unRAID before writing so it puts the file in the appropriate location?


I ask to know if what's on the Synology unit is the right fit for unRAID or rotate it to another server and that server's to unRAID. Thanks!

Link to post

I understood NO but I just had to look that up, I'm as curious as a cat…or a Schnauzer mini. I just learned four new things today just in this page. :) I'm sure I'll die bc I was being nosey or something and I had to go look. 😂


Anyway, thanks again, you're awesome.

Link to post

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.

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.