All of lore.kernel.org
 help / color / mirror / Atom feed
* Speed up mount time?
@ 2022-11-23 12:33 Joakim
  2022-11-23 21:44 ` Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Joakim @ 2022-11-23 12:33 UTC (permalink / raw)
  To: linux-btrfs

I have a couple of machines (A and B) set up where each machine has a
~430 TB BTRFS subvolume, same data on both. Mounting these volumes
with the following flags: noatime,compress=lzo,space_cache=v2

Initially mount times were quite long, about 10 minutes. But after i
did run a defrag with -c option on machine B the mount time increased
to over 30 minutes. This volume has a little over 100 TB stored.

How come the mount time increased by this?

And is there any way to decrease the mount times? 10 minutes is long
but acceptable, while 30 minutes is way too long.

Advice would be highly appreciated. :)



Linux sm07b 5.4.17-2136.311.6.1.el8uek.x86_64 #2 SMP Thu Sep 22
19:29:28 PDT 2022 x86_64 x86_64 x86_64 GNU/Linux
btrfs-progs v5.15.1
Label: 'Storage'  uuid: 6ecd172e-3ebd-478c-9515-68162a41590d
        Total devices 1 FS bytes used 105.04TiB
        devid    1 size 436.57TiB used 107.87TiB path /dev/sdb

Data, single: total=107.34TiB, used=104.82TiB
System, DUP: total=40.00MiB, used=11.23MiB
Metadata, DUP: total=269.00GiB, used=221.57GiB
GlobalReserve, single: total=512.00MiB, used=0.00B

[   51.764445] BTRFS info (device sdb): flagging fs with big metadata feature
[   51.764450] BTRFS info (device sdb): use lzo compression, level 0
[   51.764454] BTRFS info (device sdb): using free space tree
[   51.764455] BTRFS info (device sdb): has skinny extents

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Speed up mount time?
  2022-11-23 12:33 Speed up mount time? Joakim
@ 2022-11-23 21:44 ` Qu Wenruo
  2022-11-25  8:55   ` Joakim
  2022-11-23 22:01 ` Roman Mamedov
  2022-11-23 22:15 ` Forza
  2 siblings, 1 reply; 11+ messages in thread
From: Qu Wenruo @ 2022-11-23 21:44 UTC (permalink / raw)
  To: Joakim, linux-btrfs



On 2022/11/23 20:33, Joakim wrote:
> I have a couple of machines (A and B) set up where each machine has a
> ~430 TB BTRFS subvolume, same data on both. Mounting these volumes
> with the following flags: noatime,compress=lzo,space_cache=v2
> 
> Initially mount times were quite long, about 10 minutes. But after i
> did run a defrag with -c option on machine B the mount time increased
> to over 30 minutes. This volume has a little over 100 TB stored.
> 
> How come the mount time increased by this?

In kernel 6.2 release, we will have block-group-tree feature, which 
should greatly reduce the mount time.

And we will provide btrfs-progs tool to do an offline convert, keeping 
the data and enable the new feature.

Thanks,
Qu
> 
> And is there any way to decrease the mount times? 10 minutes is long
> but acceptable, while 30 minutes is way too long.
> 
> Advice would be highly appreciated. :)
> 
> 
> 
> Linux sm07b 5.4.17-2136.311.6.1.el8uek.x86_64 #2 SMP Thu Sep 22
> 19:29:28 PDT 2022 x86_64 x86_64 x86_64 GNU/Linux
> btrfs-progs v5.15.1
> Label: 'Storage'  uuid: 6ecd172e-3ebd-478c-9515-68162a41590d
>          Total devices 1 FS bytes used 105.04TiB
>          devid    1 size 436.57TiB used 107.87TiB path /dev/sdb
> 
> Data, single: total=107.34TiB, used=104.82TiB
> System, DUP: total=40.00MiB, used=11.23MiB
> Metadata, DUP: total=269.00GiB, used=221.57GiB
> GlobalReserve, single: total=512.00MiB, used=0.00B
> 
> [   51.764445] BTRFS info (device sdb): flagging fs with big metadata feature
> [   51.764450] BTRFS info (device sdb): use lzo compression, level 0
> [   51.764454] BTRFS info (device sdb): using free space tree
> [   51.764455] BTRFS info (device sdb): has skinny extents

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Speed up mount time?
  2022-11-23 12:33 Speed up mount time? Joakim
  2022-11-23 21:44 ` Qu Wenruo
@ 2022-11-23 22:01 ` Roman Mamedov
  2022-11-25  8:57   ` Joakim
  2022-11-23 22:15 ` Forza
  2 siblings, 1 reply; 11+ messages in thread
From: Roman Mamedov @ 2022-11-23 22:01 UTC (permalink / raw)
  To: Joakim; +Cc: linux-btrfs

On Wed, 23 Nov 2022 13:33:17 +0100
Joakim <ahoj79@gmail.com> wrote:

> Initially mount times were quite long, about 10 minutes. But after i
> did run a defrag with -c option on machine B the mount time increased
> to over 30 minutes. This volume has a little over 100 TB stored.
> 
> How come the mount time increased by this?

With compression each file now has to be split into extents each at most 128K
long, which means there are much more extents to keep track of than before.

> And is there any way to decrease the mount times? 10 minutes is long
> but acceptable, while 30 minutes is way too long.
> 
> Advice would be highly appreciated. :)

It is unfortunate that you use the bare sdb device, if you used LVM, you could
easily add an SSD and deploy LVM caching in writethrough mode (or a RAID1 of
SSDs and use the writeback mode). In my experience LVM caching of HDD based
storage to SSDs improves mount times of Btrfs really by a lot.

There have been a number of attempts to implement Btrfs native storage tiering
of HDDs vs SSDs (storing metadata on the latter), such as [1], but none have
made it so far, and the patches from 2020 probably no longer apply.

[1]https://lwn.net/ml/linux-btrfs/20201029053556.10619-1-wangyugui@e16-tech.com/

-- 
With respect,
Roman

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Speed up mount time?
  2022-11-23 12:33 Speed up mount time? Joakim
  2022-11-23 21:44 ` Qu Wenruo
  2022-11-23 22:01 ` Roman Mamedov
@ 2022-11-23 22:15 ` Forza
  2022-11-25  8:58   ` Joakim
  2 siblings, 1 reply; 11+ messages in thread
From: Forza @ 2022-11-23 22:15 UTC (permalink / raw)
  To: Joakim, linux-btrfs



---- From: Joakim <ahoj79@gmail.com> -- Sent: 2022-11-23 - 13:33 ----

> I have a couple of machines (A and B) set up where each machine has a
> ~430 TB BTRFS subvolume, same data on both. Mounting these volumes
> with the following flags: noatime,compress=lzo,space_cache=v2
> 
> Initially mount times were quite long, about 10 minutes. But after i
> did run a defrag with -c option on machine B the mount time increased
> to over 30 minutes. This volume has a little over 100 TB stored.
> 
> How come the mount time increased by this?

You now have now extents to keep track of, which means more metadata to parse at mount. 

> 
> And is there any way to decrease the mount times? 10 minutes is long
> but acceptable, while 30 minutes is way too long.
> 
> Advice would be highly appreciated. :)
> 

You can defrag the subvolume and extent trees by using `btrfs fi defrag /path/to/subvol`. You can do this on each subvol and on the top level volume. This can reduce amounts of seeks, improving performance some. 

> 
> 
> Linux sm07b 5.4.17-2136.311.6.1.el8uek.x86_64 #2 SMP Thu Sep 22
> 19:29:28 PDT 2022 x86_64 x86_64 x86_64 GNU/Linux
> btrfs-progs v5.15.1
> Label: 'Storage'  uuid: 6ecd172e-3ebd-478c-9515-68162a41590d
>         Total devices 1 FS bytes used 105.04TiB
>         devid    1 size 436.57TiB used 107.87TiB path /dev/sdb
> 
> Data, single: total=107.34TiB, used=104.82TiB
> System, DUP: total=40.00MiB, used=11.23MiB
> Metadata, DUP: total=269.00GiB, used=221.57GiB
> GlobalReserve, single: total=512.00MiB, used=0.00B
> 
> [   51.764445] BTRFS info (device sdb): flagging fs with big metadata feature
> [   51.764450] BTRFS info (device sdb): use lzo compression, level 0
> [   51.764454] BTRFS info (device sdb): using free space tree
> [   51.764455] BTRFS info (device sdb): has skinny extents



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Speed up mount time?
  2022-11-23 21:44 ` Qu Wenruo
@ 2022-11-25  8:55   ` Joakim
  2022-11-25  9:03     ` Qu Wenruo
  0 siblings, 1 reply; 11+ messages in thread
From: Joakim @ 2022-11-25  8:55 UTC (permalink / raw)
  To: wqu; +Cc: ahoj79, linux-btrfs

That sounds great! Is there any rough ETA for when that might be released?
Thanks! :)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Speed up mount time?
  2022-11-23 22:01 ` Roman Mamedov
@ 2022-11-25  8:57   ` Joakim
  0 siblings, 0 replies; 11+ messages in thread
From: Joakim @ 2022-11-25  8:57 UTC (permalink / raw)
  To: rm; +Cc: ahoj79, linux-btrfs

Thanks for describing, now it makes sense.
Regarding LVM-caching, I will keep that in mind and perhaps try that
on the next storage cluster I deploy.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Speed up mount time?
  2022-11-23 22:15 ` Forza
@ 2022-11-25  8:58   ` Joakim
  0 siblings, 0 replies; 11+ messages in thread
From: Joakim @ 2022-11-25  8:58 UTC (permalink / raw)
  To: forza; +Cc: ahoj79, linux-btrfs

Yes, thanks! Metadata defrag finished an hour ago. But time to mount is still: 31m6.720s.
I guess I'll just have to wait for the new kernel.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Speed up mount time?
  2022-11-25  8:55   ` Joakim
@ 2022-11-25  9:03     ` Qu Wenruo
  2022-11-25  9:22       ` Joakim
  2022-12-13  0:30       ` kenneth topp
  0 siblings, 2 replies; 11+ messages in thread
From: Qu Wenruo @ 2022-11-25  9:03 UTC (permalink / raw)
  To: Joakim, wqu; +Cc: linux-btrfs



On 2022/11/25 16:55, Joakim wrote:
> That sounds great! Is there any rough ETA for when that might be released?
> Thanks! :)

As mentioned, if nothing wrong happened, v6.2 would be the target for 
the kernel.

For progs, it should already be implemented in btrfstune from the latest 
btrfs-progs.

But only one-way conversion is supported (aka, regular -> bg tree), no 
way to convert back yet.

If your distro doesn't ship newer kernel/progs, it may take much longer 
though.

Thanks,
Qu

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Speed up mount time?
  2022-11-25  9:03     ` Qu Wenruo
@ 2022-11-25  9:22       ` Joakim
  2022-11-25 22:25         ` Torbjörn Jansson
  2022-12-13  0:30       ` kenneth topp
  1 sibling, 1 reply; 11+ messages in thread
From: Joakim @ 2022-11-25  9:22 UTC (permalink / raw)
  To: quwenruo.btrfs; +Cc: ahoj79, linux-btrfs, wqu

Alright, thanks for clarification.  
This machine has Oracle Linux, so i guess there will be som waiting.

//Joakim

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Speed up mount time?
  2022-11-25  9:22       ` Joakim
@ 2022-11-25 22:25         ` Torbjörn Jansson
  0 siblings, 0 replies; 11+ messages in thread
From: Torbjörn Jansson @ 2022-11-25 22:25 UTC (permalink / raw)
  To: Joakim, quwenruo.btrfs; +Cc: linux-btrfs, wqu

On 2022-11-25 10:22, Joakim wrote:
> Alright, thanks for clarification.
> This machine has Oracle Linux, so i guess there will be som waiting.
> 
> //Joakim

Quoting the original mail when replying helps a lot to understand what you are 
actually replying to.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Speed up mount time?
  2022-11-25  9:03     ` Qu Wenruo
  2022-11-25  9:22       ` Joakim
@ 2022-12-13  0:30       ` kenneth topp
  1 sibling, 0 replies; 11+ messages in thread
From: kenneth topp @ 2022-12-13  0:30 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: Joakim, wqu, linux-btrfs




On Fri, 25 Nov 2022, Qu Wenruo wrote:

>
>
> On 2022/11/25 16:55, Joakim wrote:
>>  That sounds great! Is there any rough ETA for when that might be released?
>>  Thanks! :)
>
> As mentioned, if nothing wrong happened, v6.2 would be the target for the 
> kernel.

Am I mistaken this was actually inside v6.1 and not 6.2?

https://lore.kernel.org/lkml/cover.1664798047.git.dsterba@suse.com/

I'm eager to give this a shot if it is, as 6.1 was just tagged.

Ken

>
> For progs, it should already be implemented in btrfstune from the latest 
> btrfs-progs.
>
> But only one-way conversion is supported (aka, regular -> bg tree), no way to 
> convert back yet.
>
> If your distro doesn't ship newer kernel/progs, it may take much longer 
> though.
>
> Thanks,
> Qu
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-12-13  0:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 12:33 Speed up mount time? Joakim
2022-11-23 21:44 ` Qu Wenruo
2022-11-25  8:55   ` Joakim
2022-11-25  9:03     ` Qu Wenruo
2022-11-25  9:22       ` Joakim
2022-11-25 22:25         ` Torbjörn Jansson
2022-12-13  0:30       ` kenneth topp
2022-11-23 22:01 ` Roman Mamedov
2022-11-25  8:57   ` Joakim
2022-11-23 22:15 ` Forza
2022-11-25  8:58   ` Joakim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.