Only one garbage collection should be running per project at once
During the deploy of 9.4.1, one of our Sidekiq nodes ran out of memory because git repack
was being run multiple times for a repository that was 82GB in size:
stanhu@sidekiq-besteffort01:~$ ps -ef | grep pack-obj
stanhu 5515 5280 0 22:57 pts/1 00:00:00 grep --color=auto pack-obj
git 17417 17413 1 12:57 ? 00:08:57 git pack-objects --keep-true-parents --non-empty --all --reflog --indexed-objects --write-bitmap-index --unpack-unreachable --delta-base-offset objects/pack/.tmp-17413-pack
git 40993 40985 1 14:09 ? 00:05:34 git pack-objects --keep-true-parents --non-empty --all --reflog --indexed-objects --write-bitmap-index --unpack-unreachable --delta-base-offset objects/pack/.tmp-40985-pack
git 52855 52854 4 10:53 ? 00:30:32 git pack-objects --keep-true-parents --non-empty --all --reflog --indexed-objects --write-bitmap-index --unpack-unreachable=2.weeks.ago --local --delta-base-offset objects/pack/.tmp-52854-pack
git 63174 63172 1 11:41 ? 00:11:51 git pack-objects --keep-true-parents --non-empty --all --reflog --indexed-objects --write-bitmap-index --unpack-unreachable --delta-base-offset objects/pack/.tmp-63172-pack
/cc: @mydigitalself, @DouweM