-
Notifications
You must be signed in to change notification settings - Fork 99
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
Stop sending network requests in seek operation for fetching chunked blobs #126
Comments
What is in that HTTP request? Can you link to the relevant parts of the code? |
Thanks for reminding. This is talking about the implementation of seekable reader utility in oras-go/internal/httputil/seek.go Line 65 in 2e7b65f
Which is used in below code to let blob store fetch operation to support resumable pulling oras-go/registry/remote/repository.go Lines 673 to 679 in 2e7b65f
|
Is this still on anyone's radar? I saw the behaviour as I'm working on resumable downloads and just removed it. |
Hi @dtroyer-salad , we have not put efforts on this perf enhancement because we were not aware of a real use case. Could you share your scenarios of resumable downloads? |
Pulling large images over networks that we do not control has led to a number of occasions where downloads get 'stuck' on the a large layer, restarting the entire layer from scratch repeatedly. As a specific example, a ~20GB image had a single ~18GB layer that never completed downloading due to the restarts. My current implementation has dropped using readSeekCloser altogether in the resume codepath in favor of just setting the Range header for the remaining blob bits not already on disk. |
Another (partial) use case for Lines 347 to 359 in 11d464f
If the This same resiliency feature applies to #338 |
If a oras-go user want to get a blob chunk from a remote target, he/she can
In the currently implementation, while calling the seek operation, a HTTP request will be sent to the remote registry. So if a user seek multiple time before reading out a single chunk, more than one network request will be sent out.
We should change the implementation to: maintain a position status while doing seek operation and only send out the ranged network request while reading out the chunked content.
Actually this is the same design used by common file systems: when reading out one chunk in a large file,
fseek
will not cause any IO operation, only thefread
will.The text was updated successfully, but these errors were encountered: