Add an exponentially rolling garbage collection script

git-exproll is a git garbage collection script aimed
specifically at reducing exccessive garbage collection and
particularly large packfile churn for Gerrit installations.

Excessive garbage collection on "dormant" repos is wasteful
of both CPU and disk IO.  Large packfile churn can lead to
heavy RAM and FS usage on Gerrit servers when the Gerrit
process continues to hold open the old delete packfiles.
This situation is most detrimental when jgit is configured
with large caching parameters.  Aside from these downsides,
running git gc often can be very beneficial to performance
on servers.  This script attempts to implement a git gc
policy which avoids the downsides mentioned above so that
git gc can be comfortably run very regularly.

git-exproll.sh uses keep files to manage which files will
get repacked.  It also uses timestamps on the repos to
detect dormant repos to avoid repacking them at all.  The
primary packfile objective is to keep around a series of
packfiles with sizes spaced out exponentially from each
other, and to roll smaller packfiles into larger ones once
the smaller ones have grown.  This strategy attempts to
balance disk space usage with avoiding rewriting large
packfiles most of the time.

The exponential packing objective above does not save a
large amount of time or CPU, but it does prevent the
packfile churn.  Depending on repo usage, however the
dormant repo detection and avoidance can result in a very
large time savings.

Change-Id: I5e8c3cc02f6ca382d34f62af2cf12a9cb8ffd21e
1 file changed