Potential Bottleneck in Usage of io.Copy
for Large File Downloads from S3
#2662
Labels
enhancement
Change to SDK that resolves an issue improves existing functionality.
When attempting to download a file from S3 using the SDK, I noticed download times taking a very long time. After enabling of the HTTP requests to S3 and logging before and after of the
download
call, I noticed a large gap between the logging of the HTTP request and when the download finished. I dug further into the SDK and added logging specifically withindownload.go
around line 407 and 413.I used
time.Now
andtime.Since
to see how long the HTTP calls took and how long the call toio.Copy
took. It turns out that the calls ofio.Copy
took the longest to execute. In the SDK, I updated the following code to output how long each call was taking:Decreasing the
PartSize
and increasing theConcurrency
helps to relieve the bottleneck.Go isn't my primary language so let me know if there's any information that I'm missing.
Version of AWS SDK for Go?
1.16.34
Version of Go (
go version
)?go version go1.12.1 linux/amd64
What issue did you see?
io.Copy
takes seconds to run after downloading a file from S3.Steps to reproduce
If you have an runnable example, please include it.
https://gist.github.com/jeremy-green/d09f80e8d5ca62798488fcd00e885a22
The text was updated successfully, but these errors were encountered: