Improved performance of the delete API for the Container Registry front end
Problem to solve
The GitLab Container Registry allows developers to build, push and share Docker images/tags using the Docker client and/or GitLab CI/CD.
For organizations that build many images across many projects, it is important to regularly remove old, unused images and tags. There are two required steps for deleting images from the registry. The first is to untag images, which can be done via the Container Registry UI or leveraging the Container Registry API. The second step is to run garbage collection and remove any blobs (can be layers or manifests)from storage.
The problem is that the API (
Projects::Registry::TagsController#bulk_destroy) is currently the worst performing controller/action on GitLab.com. It has a p95 of 40s and some requests take up to 60s to complete.
Projects::Registry::TagsController#destroy is not far behind.
- Delaney (Development Team Lead)
- Sasha (Software Developer)
- Devon (DevOps Engineer)
- Sidney (Systems Administrator)
- Examples of this request on GitLab.com: https://log.gitlab.net/goto/f29aea9c71acf7116fac0f84ac17ca95
User Interface Example
- The bulk delete API does currently run as a background job.
- The API that powers the front end is not a background job.
- Improve the performance of the delete API that powers the frontend, so that we improve the performance and availability of the Container Registry user interface.
- One option could be moving it to a background job.
- Another could be improving the logic or optimizing the code (if possible)