All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Ralf Groß" <ralf.gross+xfs@gmail.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: memory requirements for a 400TB fs with reflinks
Date: Wed, 24 Mar 2021 09:02:39 +1100	[thread overview]
Message-ID: <20210323220239.GG63242@dread.disaster.area> (raw)
In-Reply-To: <CANSSxyk0sKzTmUKitwsxvip-N+TdLmPDrHYFAL9TUDB7gs1Bsg@mail.gmail.com>

On Tue, Mar 23, 2021 at 10:39:27AM +0100, Ralf Groß wrote:
> Hi Dave,
> 
> > People are busy, and you posted on a weekend. Have some patience,
> > please.
> 
> I know, sorry for that.
> 
> > ....
> >
> > So there's no one answer - the amount of RAM xfs_repair might need
> > largely depends on what you are storing in the filesystem.
> 
> I just checked our existing backups repositories. The backup files are
> VMware image backup files, daily ones are smaller, weekly/GFS larger.
> But the are not millions of smaller files. For primary backup there
> are ~25.000 files in 68 TB of a 100 TB share, for a new repository
> with a 400 TB fs this would result in ~150.000 files. For the the
> secondary copy repository I see 3000 files in a 100 TB share. This
> would there result in ~200.000 files in a 700 TB repository. Is there
> any formula to calculate the memory requirement for a number of files?

Worse case static data indexing memory usage can be reported by
xfs_repair itself by abusing verbose reporting and memory limiting.
A 500TB filesystem with 50 million zero length files in it:

# xfs_repair -n -vvv -m 1 /dev/vdc
Phase 1 - find and verify superblock...
        - reporting progress in intervals of 15 minutes
        - max_mem = 1024, icount = 51221120, imem = 200082, dblock = 134217727500, dmem = 65535999
Required memory for repair is greater that the maximum specified
with the -m option. Please increase it to at least 64244.
#

Says that worst case it is going to need "dmem = 65535999" to index
the space usage. That's 64GB of RAM. Inode based requirements are
"imem = 200082" another 200MB for indexing 50 million inodes. Of
course, there is the inodes themselves and all the other metadata
that need to be brought into RAM, but that is typically paged in and
out of the buffer cache that is not actually included in these
memory usage counts.

So for a 500GB filesystem with minimal metadata and large contiguous
files as you describe you're probably only going to need a few GB of
RAM to repair it. OF course, if things get broken, then you should
plan for worst case minimums as described by xfs_repair above...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2021-03-23 22:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20 18:01 memory requirements for a 400TB fs with reflinks Ralf Groß
2021-03-22 16:50 ` Ralf Groß
2021-03-22 21:50   ` Dave Chinner
2021-03-23  9:39     ` Ralf Groß
2021-03-23 22:02       ` Dave Chinner [this message]
2021-03-23  9:31   ` Lucas Stach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210323220239.GG63242@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ralf.gross+xfs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.