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

Set TCP keepalive on Redshift (#782) #826

Merged
merged 2 commits into from
Jul 11, 2018
Merged

Set TCP keepalive on Redshift (#782) #826

merged 2 commits into from
Jul 11, 2018

Conversation

beckjake
Copy link
Contributor

@beckjake beckjake commented Jul 6, 2018

Set TCP keepalives on Redshift (and provide it as an option on Postgres). Users can disable setting the value if they want by explicitly setting the keepalives_idle parameter in the connection profile to 0, which will make it use the system default.

This should fix #782

@beckjake
Copy link
Contributor Author

beckjake commented Jul 6, 2018

@ryanmcdonnell If you're interested in testing out a branch that may fix your connectivity issues, you can give the tcp-keepalives branch a try. I'd love to hear any feedback!

@beckjake beckjake requested a review from cmcarthur July 10, 2018 17:19
Copy link
Member

@cmcarthur cmcarthur left a comment

Choose a reason for hiding this comment

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

looks great.

@@ -9,6 +9,9 @@


class RedshiftAdapter(PostgresAdapter):

DEFAULT_TCP_KEEPALIVE = 240
Copy link
Member

Choose a reason for hiding this comment

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

just curious... where did this number come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Drew linked me to this which has a docstring bit that says:

Note: For Redshift, use keepalives_idle in the extra connection parameters and set it to less than 300 seconds.

I wasn't sure how precise the 300 value was or where they sourced it from, so I figured one minute less would give us a bit more wiggle room on slightly flaky connections and stuff. Now that I think about it, they probably did the same thing with whatever their source was and 300 is also conservative, but hey, a few extra keepalives shouldn't hurt.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@beckjake beckjake merged commit 19be61a into development Jul 11, 2018
@beckjake beckjake deleted the tcp-keepalives branch July 11, 2018 13:42
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

Successfully merging this pull request may close these issues.

3 participants