Skip to content

Commit 60dc587

Browse files
Repack cruft in overlay repo (#1343)
--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
1 parent daa7a03 commit 60dc587

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

josh-core/src/housekeeping.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ pub fn get_known_filters() -> JoshResult<std::collections::BTreeMap<String, BTre
322322
}
323323

324324
pub fn run(repo_path: &std::path::Path, do_gc: bool) -> JoshResult<()> {
325+
const CRUFT_PACK_SIZE: usize = 1024 * 1024 * 64;
326+
325327
let transaction_mirror = cache::Transaction::open(&repo_path.join("mirror"), None)?;
326328
let transaction_overlay = cache::Transaction::open(&repo_path.join("overlay"), None)?;
327329

@@ -382,9 +384,11 @@ pub fn run(repo_path: &std::path::Path, do_gc: bool) -> JoshResult<()> {
382384
"git",
383385
"repack",
384386
"-dn",
385-
"--keep-unreachable",
387+
"--cruft",
388+
&format!("--max-cruft-size={}", CRUFT_PACK_SIZE),
386389
"--no-write-bitmap-index",
387-
"--threads=4"
390+
"--window-memory=128m",
391+
"--threads=4",
388392
]
389393
)
390394
);

0 commit comments

Comments
 (0)