On 2018年02月13日 20:06, John Ettedgui wrote:
>>>>
>>> That's fairly straightforward to do, though it should be quite slow so
>>> I'd hope not to have to do that too often.
>>
>> Then it could be tried on the most frequently updated files then.
> 
> That's an interesting idea.
> More than 3/4 of the data is just storage, so that should be very ok.

BTW, how the initial data is created?

If the initial data is all written once and doesn't get modified later,
then the problem may not be fragments.

> 
>>
>> And since you don't use snapshot, locate such files and then "chattr +C"
>> would make them nodatacow, reducing later fragments.
> 
> I don't understand, why would that reduce later fragments?

Later overwrite will not create new extent, but overwrite existing extents.
Other than CoW and cause new extents (fragments)

Although expand write will still cause new extent, but that's
unavoidable anyway.

Thanks,
Qu

> 
>>
>>>>    This should acts much better than traditional defrag, although it's
>>>>    time-consuming and makes snapshot completely meaningless.
>>>>    (and since you're already hitting ENOSPC, I don't think the idea is
>>>>     really working for you)
>>>>
>>>> And since you're already hitting ENOSPC, either it's caused by
>>>> unbalanced meta/data usage, or it's really going hit the limit, I would
>>>> recommend to enlarge the fs or delete some files to see if it helps.
>>>>
>>> Yup, I usually either slowly ramp up the {d,m}usage to pass it, or
>>> when that does not work I free some space, then balance will finish.
>>> Or did you mean to free some space to see about mount speed?
>>
>> Kind of, just do such freeing in advance, and try to make btrfs always
>> have unallocated space in case.
>>
> 
> I actually have very little free space on those partitions, usually
> under 90Gb, maybe that's part of my problem.
> 
>> And finally, use latest kernel if possible.
>> IIRC old kernel doesn't have empty block group auto remove, which makes
>> user need to manually balance to free some space.
>>
>> Thanks,
>> Qu
>>
> 
> I am on 4.15 so no problem there.
> 
> So manual defrag and new FS to try.
> 
> Thank you!
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to