What causes slow fetches and how do you diagnose them on the server side?
AdvancedProductionMonorepos, large files and repository performance
Answer
Typical causes: too many refs (thousands of stale PR/branch refs), no reachability bitmaps, many small packs, and lack of a commit-graph. Delete stale refs, enable bitmaps and multi-pack-index with scheduled repack, and use protocol v2. Check by tracing packet exchange.
GIT_TRACE_PACKET=1 GIT_TRACE_PERFORMANCE=1 git fetch origin 2>&1 | head -50
git for-each-ref | wc -l
More on Monorepos, large files and repository performance
What are the main trade-offs of a monorepo?IntermediateHow do you make CI efficient in a monorepo?AdvancedHow do you onboard developers to a very large repo without a 30-minute clone?IntermediateWhat does Scalar do and when do you recommend it?Advanced`git status` takes 20 seconds in a big working tree. How do you fix it?AdvancedWhen should a team adopt Git LFS and when should it avoid it?Intermediate