Skip to content

setPingConnectionInterval for node-redis #1598

Closed
@mercury200Hg

Description

@mercury200Hg

Issue

Basically, if you run redis behind AWS-NLB or Azure-Loadbalancer there's an idle timeout configured by LoadBalancer like 350 seconds for AWS and 4 minutes for azure. Despite the keepalive you set on the machine hosting redis, the connection from the node app will be dropped if it's idle for more than the above time.

Is it possible to enable a parameter like setPingConnectionInterval which basically sends a PING request to redis to keep the connection alive and prevent it from dropping?

This could be same as the setPingConnectionInterval used in Redisson client or setTestOnBorrow in jedis.

If there's existing functionality that takes care of it, please help out in pointing the same. Say- socket_initial_delay which states this will also behave the interval keep-alive message sending to Redis. From what I understand it will keep on sending the messages to keep the connection alive other than the initial delay. Correct me if i am wrong here.


Environment

  • Node.js Version: 9.1.0
  • Redis Version: 5.0.6
  • Platform: Ubuntu-18.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    EvaluatingThis ticket is still taken into consideration without a clear path forward.feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions