Skip to content

Reduce the volume of HEAD requests by caching proxy cache ManifestExist calls #21859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mxm-tr opened this issue Apr 10, 2025 · 1 comment
Open
Labels
area/proxy-cache backlog kind/requirement New feature or idea on top of harbor

Comments

@mxm-tr
Copy link

mxm-tr commented Apr 10, 2025

Is your feature request related to a problem? Please describe.
When pulling many artifacts at the same time on a container proxy-cache, we can still trigger the rate limiting on the upstream registries and get 429 Too Many Requests errors.

This is in part caused by HEAD requests being sent for each artifact pull.

Describe the solution you'd like

This feature request aims to reduce the load on upstream registries by caching head requests when pulling from a proxy-cache registry.

The solution could consist of a cache for calls to HeadManifest, perhaps configurable to be valid for a certain period of time?

Describe the main design/architecture of your solution

  1. Use a new cache key in the proxy controller cache, such as:
cache:manifestexists:<repo>:<ref>
  1. Define its lifetime to a value that would prevent rate limiting from being triggered (10s?) in the proxy-controller
manifestExistsCacheInterval = 10 * time.Second
  1. Before running remote.ManifestExist, run a cache fetch on the proxy controller cache.

If the cache is invalid or the key is not found, run remote.ManifestExist, and save a boolean in the proxy controller cache.

Describe the development plan you've considered

Additional context
Since this feature would change the default behavior of the proxy-cache, it may trigger more discussions.

@stonezdj stonezdj added kind/requirement New feature or idea on top of harbor area/proxy-cache backlog labels Apr 14, 2025
@mxm-tr
Copy link
Author

mxm-tr commented Apr 16, 2025

Proposal was drafted here: goharbor/community#261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/proxy-cache backlog kind/requirement New feature or idea on top of harbor
Projects
None yet
Development

No branches or pull requests

2 participants