Do I have to balance periodically for single-ssd cache?


testdasi

Recommended Posts

My understanding from the help text is that balance is only required for multi-disk cache.

However, I read some other threads on the forum that (I think) suggest that balance should be run periodically in addition to trim, as a generic recommendation.

It appears to solve problem of having a false error of running out of space when there are still plenty of free space available.

 

Link to comment
5 hours ago, itimpi said:

If you only have a single drive in the cache then XFS is likely to be more stable and performance file system to use.   If you use XFS then balance operations are not applicable.

 

I used btrfs, remnant from the time when I wanted RAID1 for cache. :$

 

So for btrfs, do I still have to balance if only 1 disk?

Link to comment
  • 2 weeks later...
On 11/13/2017 at 10:26 AM, johnnie.black said:

 

You can use the user scripts plugin to schedule it.

I'm just running my first balance - it looks like I should have been doing frequently as so far it's balanced 24 out of 27 considered (469 in total).  I'm going to setup a script job as suggested - what commands do you recommend for a weekly job?

 

Has the only impact been the loss of space on my cache pool as a result of not balancing, or have I had a speed impact?  I'm guessing there's been a potential speed impact as I believe unRAID alternates which cache drive it reads from, so if a file only exists on one, I will have been a 'bit' slower??

 

Should I also setup a regular scrub job?

Edited by DZMM
Link to comment
1 minute ago, DZMM said:

what commands do you recommend for a weekly job?

 

btrfs balance start -dusage=75 /mnt/cache

 

2 minutes ago, DZMM said:

Has the only impact been the loss of space on my cache pool as a result of not balancing, or have I had a speed impact?

 

It doesn't cause loss of space, it can cause ENOSPC errors if the file system gets to be fully allocated.

It does have a speed impact since there's currently a bug where most or all allocated but free space is not trimmed.

 

4 minutes ago, DZMM said:

Should I also setup a regular scrub job?

If all is working well it's not really needed, but running say a monthly scrub can be good practice.

  • Like 1
Link to comment
7 minutes ago, johnnie.black said:

 


btrfs balance start -dusage=75 /mnt/cache

 

Thanks - setup weekly job.  Is this in a FAQ somewhere as I haven't come across this before?

 

8 minutes ago, johnnie.black said:

It doesn't cause loss of space, it can cause ENOSPC errors if the file system gets to be fully allocated.

 

I run mover automatically at 80%, so I don't think my cache has ever been full luckily

 

9 minutes ago, johnnie.black said:

If all is working well it's not really needed, but running say a monthly scrub can be good practice.

Will do this.  I''m guessing the code is:

 

btrfs scrub start

I've been doing this manually now and then (not balancing though!), so no errors but will do a job so can forget about this.

Link to comment
  • 10 months later...
On 11/13/2017 at 3:32 AM, johnnie.black said:

It's a good idea to run a weekly balance, at least until we get to kernel 4.14, which is expected to fix this issue, it doesn't need to be a full balance, something like this:

 


btrfs balance start -dusage=75 /mnt/cache

 

Resurrecting an old thread because I'm interested as to whether this issue has gone away now we are on kernel 4.18.10? I just ran balance and it did return a lot of space to my cache drive. Could that have been lingering since before the kernel change?  I've never run balance before, so perhaps it's built up over the last year or so.

 

Just wondering if I need to add balance to my maintenance schedule  with V6.6.1 and kernel 4.18.10?

Link to comment
1 minute ago, Lignumaqua said:

I just ran balance and it did return a lot of space to my cache drive. Could that have been lingering since before the kernel change?  I've never run balance before, so perhaps it's built up over the last year or so. 

If you never ran one it's good to run it on the newer kernel, and anyone coming from an earlier kernel, IIRC <4.16 should run a balance, after that there's no need to run regular balance to avoid the out of space errors, though it won't hurt to run one once in a while as regular maintenance.

  • Upvote 1
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.