quota and refquota best practice

Status
Not open for further replies.

MrToddsFriends

Documentation Browser
Joined
Jan 12, 2015
Messages
1,338
I'm currently playing with the quota ("Quota for this dataset and all children" in the GUI) and refquota ("Quota for this dataset" in the GUI) properties to achieve the following goals:

1) The underlying pool (used for several datasets) should never get full.
2) The creation of snapshots should never fail with an "out of space" error due to (ref-)quota restrictions.
3) If possible, the need for administrative interventions should be kept small.

While requirement 1) could be easily achieved using appropriate quota alone, I'm not sure if the creation of a snapshot could fail if the quota for a dataset is fully exhausted. In my tests I performed so far I was not able to produce a failure during snapshot creation while quota is exhausted, but I'm not sure if I'm overlooking something.

Using refquota alone should never be an obstacle for snaposhot creation (as long as the pool is not full) but in this way the used property of a dataset can grow much larger than the refquota value, depending of the number of snapshots and the usage of the dataset (e.g. how much of the data are modified or overwritten). So using refquota is in contradiction of requirement 1).

Now to requirement 3): The downside of using quota is that users might not be able to free up usable space by deleting data as the used property doesn't necessarily decrease due to deletion if snapshots are present. As the refer property does decrease on deletion, users are able to free up usable space without administrative intervention [edit: when using refquota].

So my question is: Is there some sort of best practice, maybe by using a combination of quota and refquota properties, which is known to work flawlessly in most use cases?
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
So my question is: Is there some sort of best practice, maybe by using a combination of quota and refquota properties, which is known to work flawlessly in most use cases?

In short, there is no "most use cases" when dealing with quotas and refquotas. It's really about whether you want/need them to apply for your scenario, and then configuring them appropriately. I will say that <5%, and probably <1% really have a use for quotas and refquotas.
 

MrToddsFriends

Documentation Browser
Joined
Jan 12, 2015
Messages
1,338
Would it be a bad idea to create a dedicated (otherwise unused) dataset with the refreservation (or reservation) property set to an appropriate value, just to make sure that the underlying pool never gets filled beyond a reasonable limit (which is my main goal)?
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Would it be a bad idea to create a dedicated (otherwise unused) dataset with the refreservation (or reservation) property set to an appropriate value, just to make sure that the underlying pool never gets filled beyond a reasonable limit (which is my main goal)?
This is what I do. In fact I call that dataset RESERVED. :smile:
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah.. I've debunked that whole theory. But if you think it helps, feel free to do it.
 

MrToddsFriends

Documentation Browser
Joined
Jan 12, 2015
Messages
1,338
Yeah.. I've debunked that whole theory. But if you think it helps, feel free to do it.

In my (maybe naive and/or inexperienced view) it might help in a situation when I would like to clone a snapshot and can be sure that there is sufficient reserved space for that operation.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
I've debunked that whole theory.
No you didn't. You said it wouldn't work, but there wasn't any debunking. In fact, you almost "bunked" it by saying that you've written to files in order to free space to delete larger files. Which to the others in that thread was similar to creating a reservation on a dataset that wasn't used, which could be reduced in size later to free up space.
https://forums.freenas.org/index.ph...ny-files-please-help.12252/page-3#post-150255
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
No you didn't. You said it wouldn't work, but there wasn't any debunking. In fact, you almost "bunked" it by saying that you've written to files in order to free space to delete larger files. Which to the others in that thread was similar to creating a reservation on a dataset that wasn't used, which could be reduced in size later to free up space.
https://forums.freenas.org/index.ph...ny-files-please-help.12252/page-3#post-150255

You're missing the whole point of that discussion. Once you've filled the zpool to the point where you can do no writes, you cann't even reduce the size later.

Sorry, I'm not even going to discuss this further. Been around on this bandwagon several times, and you cannot do anything about the fact that once the zpool is 100% full, you cannot do ANYTHING. You cannot destroy a dataset, you cannot change the reservation, you cannot change *anything* except start deleting stuff via the echo command.

So yes, I stand by my comments as before. And there's a discussion older than 2014. :p

Edit: The same applies to a dataset that hits its quota. Once it's full you're kind of screwed. Gotta delete something to free up space, and you often can't free up the space.

Trust me, I handle these kinds of cases on a regular basis.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Hmm, interesting. So what about just creating a large file that can be echo'd out in case the pool gets filled? (like dd if=/dev/random of=/mnt/poolname/reserved bs=1M count= 100000 for a 100G file)

Since I'm adding things to my testing to-do list, I'll put this on there as well.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Hmm, interesting. So what about just creating a large file that can be echo'd out in case the pool gets filled? (like dd if=/dev/random of=/mnt/poolname/reserved bs=1M count= 100000 for a 100G file)

Since I'm adding things to my testing to-do list, I'll put this on there as well.

Sure, you can do that. But you now have a 100GB file that is going to count towards your 80%, and thereby give you warnings prematurely. Granted, 100GB in a 10TB pool is just 1%, but it is what it is.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Status
Not open for further replies.
Top