[go: up one dir, main page]

Catfile cache architecture

Summary

git-cat-file is used to read objects out of git repositories. Since git-cat-file supports batching and reading objects is such a common operation, to reduce the process startup cost, we cache git-cat-file processes so they can be reused for several operations.

Right now the cat-file process cache has the following properties:

  • The cache holds 200 processes (100 with mailmap, 100 without) configurable by setting git.catfile_cache_size.
  • The cache has a reconciliation loop that runs every 2 seconds (monitor).
  • The cache evicts processes that have been sitting in the queue for more than 10 seconds (TTL).
  • The cache reinserts used processes, deduplicating them based on a 5 minute interval cache key. Historically the session ID was used instead.
  • Reinserted processes get their TTL reset to give another 10 seconds in the queue.

As we no longer use session IDs we should simplify this process cache so that processes live for 5 minutes and then are evicted.

Edited by James Fargher