imgpkg icon indicating copy to clipboard operation
imgpkg copied to clipboard

[perf] imgpkg seems to make lots of repeated requests to `/v2` endpoint

Open DennisDenuto opened this issue 4 years ago • 4 comments

Description

running imgpkg pull --debug I notice lots of requests being made to the registry /v2 endpoint, trying to get a token.

When pulling a bundle with lots of images / nested bundles, I think this may contribute to a performance degradation.

It would be nice to know:

  • how much performance we lose by making repeated calls to /v2 and assuming the registry requires a bearer token, repeated calls to an oauth server
  • assuming it is causing excessive slowness, can we somehow cache the bearer token avoiding the need to make these repeated calls.

Reference:

  • https://github.com/google/go-containerregistry/issues/740

DennisDenuto avatar Oct 26 '21 22:10 DennisDenuto

This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.

github-actions[bot] avatar Dec 06 '21 00:12 github-actions[bot]

This issue needs further investigation to try to understand the reason behind the requests and if it is related to the linked issue. Added needs more info and important-longterm as labels

joaopapereira avatar Dec 06 '21 16:12 joaopapereira

This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.

github-actions[bot] avatar Jan 16 '22 00:01 github-actions[bot]

We did some investigation and the amount of requests is due to a feature from ggcr where before any request is done to a registry it pings the registry to understand the type of authentication needed to it. https://github.com/google/go-containerregistry/blob/ab77ea68f600de27f0563dbfdb1431960ad96af0/pkg/v1/remote/transport/transport.go#L53

We also found that we were doing 1 request to the OAuth server per request to the server. We are addressing this issue in #334

joaopapereira avatar Feb 18 '22 21:02 joaopapereira