1

I am using StackOverflow Redis on the Azure with the version 3.2.7 and I see the same issue of high counts of Clients Connections mentioned in below URLs. Is there any way to pass some params while connecting to Redis from client to ensure the connection should be closed automatically after certain idle time? OR Azure Redis itself should automatically close the same after seeing the idle property of the client?

I have already followed the best practices mentioned in the following blogs, but still, no luck in reducing the connections count. Why are connections to Azure Redis Cache so high? Azure Redis Cache max connections reached https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f

I came across this https://pranavprakash.net/2016/02/05/kill-idle-connections-to-redis/ article to kill them in bulk for idle one. Was looking for some properties or settings which will help us to do it automatically. Seems I am still missing something.

Thanks in advance Gangadhar

  • Additionally, I found that one of my Azure App Service that is used for continuous delivery(DevOps) and gets the application deployed every 6 hrs has active Client Connection as 3000 whereas my other VMs have only 4 (2 for Site and 2 for API) for Redis. Concern is why this single App Service has 3000 active connections and each of those still shows idle < 60 always as if all of these connections are alive and pinging back to Redis, which is not realistic as the App Service has only instance of the service running and it gets updated with the latest code every 6 hours. – Gangadhar Botla Apr 26 '19 at 13:56
  • Did you found any solution to your issue? – Janak Apr 03 '20 at 01:25

1 Answers1

0

Implement IDisposable to dispose the object after its use

        public void Dispose()
        {
            try {
                if (connection.IsValueCreated)
                {
                    connection.Value.Dispose(); 
                }
            } catch { }
        }