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

Increase connection keep alive timeout to 30 seconds #836

Merged
merged 1 commit into from
Aug 20, 2019

Conversation

brandur
Copy link
Contributor

@brandur brandur commented Aug 20, 2019

One thing I forgot to look into was how long Ruby will hold a connection
open by default. It turns out that the language default is very low at
only two seconds. Here we increase it to 30 seconds, which is a more
reasonable default. I took this number from Go's DefaultTransport,
which seems to have been working pretty well so far.

I tested with a script that keeps a connection idle to Stripe for a long
period of time before issuing a new request and everything seems to be
working well.

r? @ob-stripe
cc @stripe/api-libraries

One thing I forgot to look into was how long Ruby will hold a connection
open by default. It turns out that the language default is very low at
only two seconds. Here we increase it to 30 seconds, which is a more
reasonable default. I took this number from Go's `DefaultTransport`,
which seems to have been working pretty well so far.

I tested with a script that keeps a connection idle to Stripe for a long
period of time before issuing a new request and everything seems to be
working well.
Copy link
Contributor

@ob-stripe ob-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@brandur-stripe
Copy link
Contributor

Thanks OB!

@brandur-stripe brandur-stripe merged commit 650114a into master Aug 20, 2019
@brandur-stripe brandur-stripe deleted the brandur-keep-alive-to-30 branch August 20, 2019 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants