0
votes

So I have node app docker containers running, and they run fine, but I noticed over the course of 1-2 months all of my apps begun having errors with redis, seems like the connection is not making it / is being refused. This is the error:

Error: Redis connection to xx.x.x.xxx:xxxx failed - connect ETIMEDOUT

I've noticed that I have a few idle connections, so it seems like there is something that is not properly closing itself. I have idle connections that are months old (a problem to fix as well), but Redis shouldn't fail if I have idle connections, I'm sure I haven't hit its limit.

Any ideas?

1

1 Answers

0
votes

Redis require some specific setup in its host machine, that is why it is very attached to a "Redis ready Docker host machine" when You try to use it in a docker container environment.

You should try to add this lines:

net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1

in Your docker host machines /etc/sysctl.conf file, that run redis containers.

Please let me know if it works.