Nodejs App Engine Standard env Redis error read ECONNRESET

Viewed 931

I am running my Nodejs app on the standard environment and in every 4 minutes my redis connects throws error and then connects again,

The error is this -

"{ Error: Redis connection to xx.xxx.x.x:6379 failed - read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:111:27) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }"

But when I am running my app same Redis and node version in compute engine OR in flexible env then in both env I am not getting this error.

I have seen solutions on many websites where they are creating error handler for redis and then keeping nodeJs app from crash but the thing is why is this error happening in the first place, If this issue persists then I think it will impact my redis query performance and will cause huge delays.

1 Answers

I am not sure if you are using an external Redis instance for your application or Cloud Memorystore. These ECONNRESET errors just happens when the connection gets interrupted when contacting an endpoint. I would suggest to check what is happening in the redis instance logs when the endpoint is reached. It could be that the process that calls Redis ends too soon which if that's is the case you need to set the timeout setting in the redis.conf to something other than 0.

Related