git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Kousik Sanagavarapu <five231003@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Running out of inodes on an NFS which stores repos
Date: Sat, 6 Sep 2025 15:34:41 +0000	[thread overview]
Message-ID: <aLxUkTzuVaZrWDs2@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <20250906141711.64419-1-five231003@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2780 bytes --]

On 2025-09-06 at 14:16:12, Kousik Sanagavarapu wrote:
> Hello everyone,

Hi,

> These git repos come from another service and there are typically
> thousands of them each day. It is important to note that we only store
> the .git dir and expose a url which is configured as the remote by
> default to read and write into this repo.
> 
> All of these are small repos; usually not many files and not many
> commits too - I'd say ~5 commits on average.
> 
> Historically, when we ran out of inodes, we had implemented a few
> strategies where we used to repack the objects or archive the older
> repos and move them into another store and bring them back into this
> NFS and unarchive the repo.
> 
> However, none of these totally mitigated the issue and we still run
> into issue as the traffic increases. As a last resort,  we increased
> the disk size even though there was ton of free space left - just
> for increasing the number of inodes.
> 
> We can't delete any of these repos, no matter how old, because they are
> valuable data.
> 
> I was wondering if there was some other strategy that we could implement
> here as this seems like a problem that people might often run into. It
> would really help to here your thoughts or if you could point me to
> anywhere else.

There are a couple things that come to mind here.  You can try to set
`fetch.unpackLimit` to 1, which will cause of the objects pushed into
the repository to end up in a pack.  That means you'll usually have
only two files, the pack and index, rather than the loose objects.

If you have a large number of references, you may wish to convert the
repositories to use the reftable backend instead of the files backend
(via `git refs migrate --ref-format=reftable`), which will also tend to
use fewer files on disk.  Note that this requires a relatively new Git,
so if you need to access these repositories with an older Git version,
don't do this.

You can also periodically repack more frequently if you set
`gc.autoPackLimit` to a smaller number (in conjunction with
`fetch.unpackLimit` above).  If you have repositories that are not
packed at all, running `git gc` (or, if you don't want to remove any
objects, `git repack -d --cruft`), which will likely reduce the number
of loose objects and result in more objects being packed.

Finally, it may be useful to you to reformat the underlying file system
in a way that has more inodes.  I know ext4 supports a larger inode
ratio for repositories with many small files.  Alternatively, apparently
btrfs does not have a fixed inode ratio, so that may be helpful to avoid
running out of inodes.  I can't speak to non-Linux file systems, though.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  parent reply	other threads:[~2025-09-06 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-06 14:16 Running out of inodes on an NFS which stores repos Kousik Sanagavarapu
2025-09-06 15:28 ` rsbecker
2025-09-06 15:34 ` brian m. carlson [this message]
2025-09-08  7:05   ` Kousik Sanagavarapu
2025-09-09  0:29     ` brian m. carlson
2025-09-09  7:39       ` Kousik Sanagavarapu

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=aLxUkTzuVaZrWDs2@fruit.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=five231003@gmail.com \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).