Skip to content
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

Any way to configure keepAlive to reuse connections ? #522

Open
juanviamonte opened this issue Dec 18, 2021 · 3 comments
Open

Any way to configure keepAlive to reuse connections ? #522

juanviamonte opened this issue Dec 18, 2021 · 3 comments

Comments

@juanviamonte
Copy link

We love this project! is there any ways to: Any way to configure keepAlive to reuse connections ?

Thansk a lot

@andrykonchin
Copy link
Member

andrykonchin commented Dec 18, 2021

I am not aware of any explicit configuration option to manage the Keep-Alive header in the AWS SDK.

But looks like AWS SDK re-uses connection by default. There is a pool of HTTP clients and the http_idle_timeout option that declares how much time not used HTTP client is kept in the pool (documentation).

Moreover, looks like this option is used also to set the Keep-Alive header (for the Net::HTTP client):

https://github.com/aws/aws-sdk-ruby/blob/9557e95a0b72a3c324e81443237745d9b6e3f3e8/gems/aws-sdk-core/lib/seahorse/client/net_http/connection_pool.rb#L284

I haven't checked manually whether TCP connections are re-used by sequenced API calls to DynamoDB but looks like they should, out of the box.

@andrykonchin
Copy link
Member

I have checked manually and found out that connections are reused in scope of a single Ruby process within configured http_idle_timeout interval. So TCP-connection to some service (and region) can be reused by any other client object.

@juanviamonte
Copy link
Author

@andrykonchin thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants