2

I am using nelikelov/redisclient version 0.5.0 and I am using code same as in the PUBSUB example provided in the library. My application subscribes to a channel and receives messages. What I am facing is that every Monday, the application is not being able to receive messages from Redis.

Is there any timeout that I should handle in case the connection remains idle during the weekend? Shall I configure something extra in my application or in Redis to bypass this?

georgeliatsos
  • 1,168
  • 3
  • 15
  • 34

1 Answers1

2

I'm not familiar with the client you're using, but Redis itself doesn't close idle connections (PubSub or not) by default and keeps them alive. You can verify that your Redis server is configured to maintain idle connections and keep them alive by examining the values of the timeout and tcp-keepalive directives (0 and 300 by default, respectively).

Other than the above and given the periodical aspect of the disconnects, I'd investigate the network settings of the client application server.

Itamar Haber
  • 47,336
  • 7
  • 91
  • 117
  • Hi Itamar, I checked Redis conf with CONFIG GET command and it seems that both timeout and tcp-keepalive are 0. – georgeliatsos Jan 08 '18 at 14:26
  • 1
    Then that is definitely suggestive of a network configuration issue. – Itamar Haber Jan 09 '18 at 14:40
  • I tried the solution but it didn't solve the problem. After an idle weekend, I check how many subscribers are listening to the channel (PUBSUB NUMSUB test-channel) and it returns 0. I will continue the investigation. – georgeliatsos Jan 25 '18 at 13:52
  • Hi @georgeliatsos, were you able to understand why it kept disconnecting? I'm using the python redis client and facing the same issue of disconnect over the weekend :( – Sayyed Humaira Khatoon Jan 16 '21 at 13:54
  • 1
    Hi @SayyedHumairaKhatoon, as far as I remember it had to do with the C++ redis client that we have used and the docker. – georgeliatsos Jan 18 '21 at 07:13