Skip to content

Enable Parallel Mark in Garbage collector - #4884

Open
ecdatadog wants to merge 4 commits into
distribution:mainfrom
DataDog:parallel_mark_gc
Open

ecdatadog wants to merge 4 commits into
distribution:mainfrom
DataDog:parallel_mark_gc

Conversation

@ecdatadog

@ecdatadog ecdatadog commented Jun 1, 2026 •

Copy link
Copy Markdown

Partial Implementation of #4883

The garbage collector is currently a sequential mark and sweep iterating over all the files which is especially long when using remote object backend (such as s3).

This PR allows users to configure the parallelism of the mark phasis (by default, the parallelism stay at 1) to accelerate the GC process.

When parallelizing, the main fear was to have some race conditions and fear to mistakenly delete artifacts. I tested (in dry run) on the same repository by executing many times the GC and get the same result.

Test : With a mid sized registry (4000 blobs, 1000 images) hosted on s3, I went from 29 minutes to 3 minutes by setting a parallelism of 16.

Additional changes :

  • added a sighandler to get informations on the status of the garbage collector on demand (useful in quiet mode)
  • modify the Makefile to natively build on OS other than Linux (tested on macOS)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant