From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4C06C3A59F for ; Wed, 23 Nov 2022 22:02:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231998AbiKWWCO (ORCPT ); Wed, 23 Nov 2022 17:02:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232214AbiKWWB6 (ORCPT ); Wed, 23 Nov 2022 17:01:58 -0500 Received: from len.romanrm.net (len.romanrm.net [IPv6:2001:41d0:1:8b3b::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4131CFB99 for ; Wed, 23 Nov 2022 14:01:54 -0800 (PST) Received: from nvm (nvm2.home.romanrm.net [IPv6:fd39::4a:3cff:fe57:d6b5]) by len.romanrm.net (Postfix) with SMTP id A90FB400C8; Wed, 23 Nov 2022 22:01:50 +0000 (UTC) Date: Thu, 24 Nov 2022 03:01:50 +0500 From: Roman Mamedov To: Joakim Cc: linux-btrfs@vger.kernel.org Subject: Re: Speed up mount time? Message-ID: <20221124030150.0b064549@nvm> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Wed, 23 Nov 2022 13:33:17 +0100 Joakim 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