Skip to content

Conversation

@kumekay
Copy link
Collaborator

@kumekay kumekay commented Sep 19, 2025

This PR improves performance of our Git mirror by adding maintenance steps that optimize packfiles and speed up fetch/clone operations:

git repack -Ad --write-bitmap-index --pack-kept-objects
Consolidates objects into a single optimized packfile and generates a bitmap index.
→ Reduces disk usage, lowers CPU/memory load on git-upload-pack, and makes clones/fetches faster.

git multi-pack-index write --bitmap
Ensures a multi-pack-index with bitmaps is always available, even between full repacks.
→ Keeps incremental fetches efficient without requiring constant heavy repacks.

Together, these changes ensure our mirror serves shallow clones and high-volume fetches more efficiently, with significantly less resource usage under load.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances Git mirror performance by implementing bitmap index generation and multi-pack-index management to optimize fetch/clone operations. The changes introduce automated maintenance routines that reduce resource usage and improve mirror responsiveness under high load.

Key changes:

  • Added periodic bitmap index regeneration with configurable intervals
  • Implemented multi-pack-index updates for incremental performance gains
  • Updated configuration to support bitmap maintenance scheduling

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
mirror.go Adds bitmap and multi-pack-index refresh functions with Git optimization commands
main.go Implements periodic bitmap regeneration goroutine with configurable intervals
example-config.toml Adds BitmapInterval configuration option with 10-hour default
config.go Updates configuration parsing to handle bitmap intervals and modernizes file reading
Dockerfile Updates Go version from 1.23 to 1.25

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@tomassebestik tomassebestik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kumekay When this is merged, pls remove the reboot timer from the Docker cache machine (link with details in MatterMost DM).

@kumekay kumekay force-pushed the feat/use-bitmap branch 2 times, most recently from b11e87f to 70d6ab6 Compare October 8, 2025 12:38
@kumekay kumekay merged commit 992d8a6 into master Oct 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants