git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Haylin Moore <hmoore@qumulo.com>
Cc: git@vger.kernel.org
Subject: Re: git only writing 4k at a time
Date: Wed, 18 Jun 2025 22:27:30 +0000	[thread overview]
Message-ID: <aFM9Uh0K2TSAuoHb@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <CALnKHDCH_174KnP6Um+G8YCpDBGNNk40xS0T2K6VtnDv9hE37Q@mail.gmail.com>

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

On 2025-06-18 at 20:58:52, Haylin Moore wrote:
> Hiya list,
> 
> I've been investigating some performance issues around git clones over
> network mounts. We have noticed that git is only writing 4k at a time.
> These small serial writes are making it such that even though each
> write is only a 3ms operation, the total time balloons. Looking around
> the source code I found that reftable_writer is initialized by default
> (though I cannot find the block_size argument being supplied in my
> cursory look) always to DEFAULT_BLOCK_SIZE (4096). Is there some way
> to increase/configure this block size such that larger writes happen?
> In git/Documentation/config/reftable.adoc this block size is mentioned
> in a manner that almost feels configurable, but I'm not sure if this
> is just internal for development.

It's fine to adjust reftable.blockSize upwards if you'd like, which
controls the block size for reftable writes (which is what you're seeing
if the writes are from the reftable code).  I think at least some
versions of JGit use 64 KiB for various reasons.

As the documentation describes, there may be some performance penalties
during reads since more refs will have to be read, so reading a single
ref will likely be more expensive.  However, you may find that
acceptable and you can adjust the values such that they provide the
right balance in your environment.  I would definitely recommend a
power-of-two block size, though.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

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

  reply	other threads:[~2025-06-18 22:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18 20:58 git only writing 4k at a time Haylin Moore
2025-06-18 22:27 ` brian m. carlson [this message]
2025-07-01 11:58   ` Patrick Steinhardt

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=aFM9Uh0K2TSAuoHb@fruit.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=hmoore@qumulo.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 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).