-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
S3 Client: HTTP Connection Reuse Fails Once Per 100 Requests #2825
Comments
Hi @shanebarnes, thanks for reaching out to us about this. After doing some testing I've found that this looks to be a behavior of S3 rather than the AWS SDK for Go - after S3 receives 100 requests on a given connection it will close this connection, forcing the client to create a new connection for the following 100 requests. |
Thanks @diehlaws for the explanation. I was able to confirm as well using Wireshark that the |
I think the lack of Connection closed header is due to the Go HTTP client or transport removing that header. |
@shanebarnes No problem! I'll go ahead and close out this issue since it doesn't look like there's anything left to do here, if you have further questions for us about this please feel free to comment on the issue and/or re-open it so we can continue working with you on this. |
The SDK appears to prevent Golang's HTTP connection pool from reusing a connection after 100 requests have been made successfully with a single HTTP connection.
Version of AWS SDK for Go?
I have observed this behavior on multiple versions of the SDK including:
Version of Go (
go version
)?I have observed this behavior on multiple versions of Go including:
What issue did you see?
When I upload files to a S3 bucket using the S3 client using either the PutObjectRequest() or UploadPartRequest() interface, it appears that the underlying HTTP/TCP connection is only reused at most for 100 requests before a new HTTP/TCP connection is created. This happens even when a single HTTP/TCP connection is busy enough to prevent an idle connection timeout from occurring and without any requests failing.
I have observed this behavior on Ubuntu 16.04 LTS and macOS 10.14.
Steps to reproduce
The sample program below uploads 101 "files" in a short amount of time. Each request prints out whether the HTTP/TCP connection was reused and the status of the completed request (success or failure).
When the preceding code sample is run, the following output occurs:
The text was updated successfully, but these errors were encountered: