Skip to content

gitserver: don't use geometric repacking

Administrator requested to merge sh/update-sg-maintenance into main

Created by: stefanhengl

Geometric repacking proved to be very memory intensive, leading to OOM kills of the sg maintenance cleanup job for monorepos on some customer instances.

For sourcegraph, we can see the OOM kills for our megarepo on dogfood. The Cloud instance has more resources and doesn't show the same behavior.

With this change we use the same repack command that git gc uses, with an additional flag "--window-memory" that limits the memory used during repack.

Test Plan

  • Added SG_PAUSE file on dogfood to pause all cleanup jobs for the megarepo
    • ran the old command -> OOM kill
    • ran the new command -> success

I tried various other config values, which limit memory during repacking, to see whether it is possible to keep geometric repacking enabled. Unfortunately without success. Here are the config values I tried:

  • pack.window 0
  • pack.deltacachesize 50m
  • pack.threads 1

Merge request reports

Loading