Hi,
We're running Gerrit 3.12 at leboncoin and facing performance issues on our main
Go monorepo for quite some time now. We have ~120 developers working on it. It
has accumulated ~1M refs in refs/changes/ over the years.
On this repo, `git review` takes ~24 seconds on average, with ~6s spent on the
SSH handshake/ref advertisement and the rest on server-side processing.
Using `git review --no-rebase` or the `git push refs/for/master` helps, but still
takes several seconds to execute.
We identified the ref count as the main culprit using `GIT_TRACE=1 git push` and
decided to try migrating to reftable.
This issue is specific to this monorepo. Our other repositories, including other
large ones, do not have the same performance problem.
First issue: After converting the repo with gerrit convert-ref-storage, every push failed with:
ClassCastException: FileReftableDatabase cannot be cast to RefDirectory
at PerThreadRefDbCache.getRefDatabase (PerThreadRefDbCache.java:33)
We found that setting core.usePerRequestRefCache = false in gerrit.config works around this.
Second issue: With usePerRequestRefCache = false and reftable enabled, we started seeing errors in production after a few hours:
ClosedChannelException
at FileChannelImpl.position
at BlockSource$2.read
at ReftableReader.readBlock
at BanCommit.loadRejectCommitsMap
This caused both push failures and UI errors (500 on change pages). We had to roll back to refdir.
Server config (relevant parts):
- core.packedGitLimit = 12g
- core.packedGitWindowSize = 32m
- core.packedGitOpenFiles = 32768
- protocol.version = 2
- gc.aggressive = true, interval = 1 day
Our questions:
- Is reftable actually usable in production for our context?
- Are there other approaches to handle 1M refs performance that we might have missed?
Thanks
Denis
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/acd91c1c-6746-497c-bdad-df4baef44a6an%40googlegroups.com.
HiWas a bit curios and I have done some investigation and this is what I found coming from some brainstorming idea with AI. I don't test it but I will do. For jgit I think you can tweak in jgit.config.
Hi MichaelOn Wednesday, 3 June 2026 at 14:50:26 UTC+1 mic...@amarulasolutions.com wrote:HiWas a bit curios and I have done some investigation and this is what I found coming from some brainstorming idea with AI. I don't test it but I will do. For jgit I think you can tweak in jgit.config.Please avoid top-posting on this list and instead use interleaved posting, as per [4].
For what concerns the AI generated document, it's clearly just a random assortment of fairly basic suggestions.
If most of those where not in place already the where be bigger issues on this Gerrit installations than the ones described so far.
Also, none of them address the ref advertisement phase that Denis mentions.
Please let's refrain from just shooting AI generated documents with untested and unvetted suggestions onto the mailing list.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/d35fe9ea-2c85-4d03-a109-0fd517a6ce8dn%40googlegroups.com.
We're running Gerrit 3.12 at leboncoin and facing performance issues on our main
Go monorepo for quite some time now. We have ~120 developers working on it. It
has accumulated ~1M refs in refs/changes/ over the years.
On this repo, `git review` takes ~24 seconds on average, with ~6s spent on the
SSH handshake/ref advertisement and the rest on server-side processing.
Using `git review --no-rebase` or the `git push refs/for/master` helps, but still
takes several seconds to execute.
First issue: After converting the repo with gerrit convert-ref-storage, every push failed with:
- gc.aggressive = true, interval = 1 day
Our questions:
- Is reftable actually usable in production for our context?
On Wednesday, June 3, 2026 at 7:04:33 AM UTC-6 denis....@adevinta.com wrote:We're running Gerrit 3.12 at leboncoin and facing performance issues on our main
Go monorepo for quite some time now. We have ~120 developers working on it. It
has accumulated ~1M refs in refs/changes/ over the years.
On this repo, `git review` takes ~24 seconds on average, with ~6s spent on the
SSH handshake/ref advertisement and the rest on server-side processing.
Using `git review --no-rebase` or the `git push refs/for/master` helps, but still
takes several seconds to execute.While I am not familiar with git review, I can confirm that 6s is not unreasonable for 1M refadvertisement. Generally, I measure this with a git ls-remote, and our server can perform anls-remote on a ~4M ref repo in about 10s. There might be some room for improvement onyours, but you are in the right ballpark.
Thanks for all the feedback, it's very helpful.> With 1M refs, the above times are expected, mainly because of the need to transfer 1M refs in text format over the wire, and that means all the ref names and their SHA1s in ASCII.It's good to know.I'm wondering if there could be a mechanism to reduce the number of advertised refs without losing history.
> If you are using this in production (aside from the google version) please add some anecdotes> for the rest of us. :)We tried, but had to rollback because of a ClosedChannelException in JGit's ReftableReader.It appeared to be a race condition related to usePerRequestRefCache = false, which was required to work around the ClassCastException.I didn't investigate further as it was too impactful for our developers.