-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JGit tuning for large repositories #4729
Comments
Another possibility is that the limitation is inherent to JGit. Exploring the implementation of |
JGit's 599 synchronized (lock(pack, position)) {
600 Entry e2 = table.get(slot);
601 if (e2 != e1) {
602 v = scan(e2, pack, position);
603 if (v != null) {
604 statsRecorder.recordHits(1);
605 return v;
606 }
607 }
608
609 v = load(pack, position);
610 final PageRef<ByteWindow> ref = createRef(pack, position, v);
611 hit(ref);
612 for (;;) {
613 final Entry n = new Entry(clean(e2), ref);
614 if (table.compareAndSet(slot, e2, n))
615 break;
616 e2 = table.get(slot);
617 }
618 } This is basically the body of the function. The 573 private static int lockCount(WindowCacheConfig cfg) {
574 return Math.max(cfg.getPackedGitOpenFiles(), 32);
575 } By default, the 48 indexer threads will get to use 32 locks, which leaves the 20ish threads blocked. Thus, bumping the |
Actually, the degradation was caused by lack of RAM in the system. The ZFS ARC got reduced to handful of percent and the system already started swapping. After bumping the RAM to 256GB this no longer happens: There might still be some room for tuning given the number of indexing threads matches the number of CPUs in the system which matches the number of locks in JGit's |
When indexing the linux Git repository from scratch with annotation cache enabled, the 2nd phase of history used the CPU sub-optimally:
Observing the thread states, there are 20 blocked indexer threads (out of 48) with stack like this one:
The indexer is running with:
Perhaps JGit can be tuned:
Namely the
packedGitLimit
option which is 10 MiB by default and given the size of the heap this is disproportional.The text was updated successfully, but these errors were encountered: