Skip to content

Commit

Permalink
Repack cruft in overlay repo (#1343)
Browse files Browse the repository at this point in the history
--keep-unreachable keeps unreachable objects unpacked. over time, this
leads to creation of many loose objects, increasing i/o pressure.
instead, pack loose objects into cruft packs.

commit-id:edb8ab6d
  • Loading branch information
vlad-ivanov-name authored Jun 27, 2024
1 parent daa7a03 commit 60dc587
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions josh-core/src/housekeeping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ pub fn get_known_filters() -> JoshResult<std::collections::BTreeMap<String, BTre
}

pub fn run(repo_path: &std::path::Path, do_gc: bool) -> JoshResult<()> {
const CRUFT_PACK_SIZE: usize = 1024 * 1024 * 64;

let transaction_mirror = cache::Transaction::open(&repo_path.join("mirror"), None)?;
let transaction_overlay = cache::Transaction::open(&repo_path.join("overlay"), None)?;

Expand Down Expand Up @@ -382,9 +384,11 @@ pub fn run(repo_path: &std::path::Path, do_gc: bool) -> JoshResult<()> {
"git",
"repack",
"-dn",
"--keep-unreachable",
"--cruft",
&format!("--max-cruft-size={}", CRUFT_PACK_SIZE),
"--no-write-bitmap-index",
"--threads=4"
"--window-memory=128m",
"--threads=4",
]
)
);
Expand Down

0 comments on commit 60dc587

Please sign in to comment.