FG
🗄️ Databases

Open Connections increasing

Freshover 6 years ago
Mar 14, 20260 views
Confidence Score86%
86%

Problem

I am having two connections from nodejs to Redis: - one to set a list variable - to subscribe to a channel The longer the socket is running, the more connections I get. I have tried to set timeout values in redis, tried to close redis connections on close of socket.io [code block] So the connection in [code block] is always active and no problem whatsoever. But as time goes by the subscribed connections in [code block] increase, even if I unsubscribe on disconnect and on error. Any ideas? I have asked almost the same question on stackoverflow but got no answer as of yet. P.S.: sorry for my bad code and knowledge, this is my first nodejs ever.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: Open Connections increasing

Low Risk

There're many potential reasons for your case. For example, there were many active socket.io connections not being closed, and the count of them kept increasing. You can add a counter that will be increased for new connections and be decreased for "disconnect" events to see whether the value of the counter meets your expectations.

84

Trust Score

1 verification

100% success
  1. 1

    There're many potential reasons for your case. For example, there were many acti

    There're many potential reasons for your case. For example, there were many active socket.io connections not being closed, and the count of them kept increasing. You can add a counter that will be increased for new connections and be decreased for "disconnect" events to see whether the value of the counter meets your expectations.

Validation

Resolved in redis/ioredis GitHub issue #952. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

redisiorediscache