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

Add docs around using health_check_interval and tcp keepalive for pubsub layer? #407

Open
justinttl opened this issue Jan 21, 2025 · 3 comments

Comments

@justinttl
Copy link

justinttl commented Jan 21, 2025

When I was deploying pubsub layer using AWS Redis ElasticCache using default paramters, I noticed that occasionally my webservers will report

Connection closed by server.

during group_send PUBLISH from redis-py client returning b'' from a stale connection.

Adding health_check_interval and tcp keep alive seems to fix the problem

            "hosts": [
                dict(
                    host=...,
                    port=...,
                    socket_keepalive=True,
                    health_check_interval=15,
                    retry_on_timeout=True,
                )
            ],

I am not sure why this issue is not present with the default implementation. (I wonder if it is because the "polling" from default impl keeps the connections in the pool alive). For PubSub, I think it makes sense since the connection could get stale if there are no activity for a while?

Anyhow, wondering if it is worth adding a section to the README regarding these config values for pubsub.

cc @acu192 as you have a lot of experience running this in production.

@carltongibson
Copy link
Member

@justinttl No problem with adding a note about this to the README.

@bigfootjon
Copy link
Collaborator

@justinttl would you be willing to write up the PR?

@justinttl
Copy link
Author

Sure - should be free later this week to throw the changes together.

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

3 participants