Description
We are using dynamic namespaces for our app. As users interact with different pages it creates more dynamic namespaces. While monitoring the app we noticed that the redis latency increased slowly over time and eventually got to a point where it was in the hours.
While troubleshooting the issue, we discovered the redis engine cpu got to 100% and then the latency really started to spike. We believe this is due to the high number redis pattern subscriptions (each namespace will do a pattern subscribe).
Looking through the source code it doesn't appear that namespaces ever unsubscribe when there are no sockets connected to them, so over time the number of pattern subscriptions continues to grow, until it gets to a point where the cpu can't keep up as you publish messages.
Are we using dynamic namespaces incorrectly? Are we not supposed to be using a large amount of dynamic namespaces?