N
Novuβ€’11mo ago
ujwal1373

Redis connection is getting stale on idle

We self hosted Novu on Azure and we are currently on version 20. We are using Azure Redis and noticed that if the worker app is idle, the redis connection is getting stale and have to restart the worker to process the messages. Is there a setting to keep the redis connection alive even though there is no traffic?
11 Replies
Zac Clifton
Zac Cliftonβ€’11mo ago
After how long do you notice it going stale?
Zac Clifton
Zac Cliftonβ€’11mo ago
GitHub
novu/packages/application-generic/src/services/in-memory-provider/p...
πŸ”₯ The open-source notification infrastructure with fully functional embedded notification center πŸš€πŸš€πŸš€ - novuhq/novu
Zac Clifton
Zac Cliftonβ€’11mo ago
assuming you are using a single redis instance Otherwise if your running two redis clusters, 1 for cache and one for queue then you would set the REDIS_CLUSTER_KEEP_ALIVE env variable
ujwal1373
ujwal1373OPβ€’11mo ago
@Zac Clifton I think Azure Redis has a timeout of 10 minutes by default.. that's when it is going stale. The Keep Alive variable is set to 30000ms by default which is 30 sec but still the connection is going stale. Does Novu have an ability to ping the Redis for every few minutes to keep it alive?
Zac Clifton
Zac Cliftonβ€’11mo ago
We do not have a cron job to do this if that is what you are asking, we are currently relying on the keepalive feature at this time
ujwal1373
ujwal1373OPβ€’11mo ago
does keepalive make sure the connection is not getting closed?
Novu_Bot
Novu_Botβ€’11mo ago
@Ujwal, you just advanced to level 4!
ujwal1373
ujwal1373OPβ€’11mo ago
do we need to explicitly set it in the env vars since the default is 30 secs anyway?
Zac Clifton
Zac Cliftonβ€’11mo ago
I would recommended tring this, we have not had this problem on our side yet as we deploy in aws but I am happy to continueing helping as much as I can on the side.
ujwal1373
ujwal1373OPβ€’11mo ago
sure I will try it and let you know, thanks Zac!
Zac Clifton
Zac Cliftonβ€’11mo ago
My pleasure
Want results from more Discord servers?
Add your server