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

socket keepalive not working for azure redis cluster #3509

Closed
ZifanL opened this issue Feb 11, 2025 · 2 comments
Closed

socket keepalive not working for azure redis cluster #3509

ZifanL opened this issue Feb 11, 2025 · 2 comments

Comments

@ZifanL
Copy link

ZifanL commented Feb 11, 2025

I have a redis cluster hosted by azure. The client side is configured as follows with socket keepalive, but the connections still get closed after being idle for some time.

client = RedisCluster(
    startup_nodes=startup_nodes,
    password=password,
    ssl=ssl,
    decode_responses=True,
    skip_full_coverage_check=True,
    socket_connect_timeout=5,
    socket_timeout=3,
    socket_keepalive=True,
    socket_keepalive_options = {
        socket.TCP_KEEPIDLE: 300,
        socket.TCP_KEEPINTVL: 5,
        socket.TCP_KEEPCNT: 5
    }
)

Does anyone know what could be the possible reason or how to debug this? Thanks!

@vladvildanov
Copy link
Collaborator

Hi! I double checked if it was an issue with SSL connections, but it looks like the socket configuration is applied correctly if you're using RedisCluster. It might be a server-side issue, connection might be closed by the server on memory usage overflow. Please follow this topic about client evictions and double check your cluster behaviour:

https://redis.io/docs/latest/develop/reference/clients/#client-eviction

@vladvildanov
Copy link
Collaborator

@ZifanL Feel free to reopen this issue if you find that it might be related to client

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