c# - Azure Redis Cache max connections reached -
i using azure redis cache storing quick lookup data , cache read/connected 10 client applications. applications written in .net 4.6, , includes asp.net mvc web application, web api , few worker roles run in every 1 second. clients using stackexchange.redis connecting cache. however, intermittent timeouts , have observed in azure portal, max connections has reached 1000 (for pricing tier). since have 10 client applications , none of these multithreaded, create 1000 connections cache?
are there best practices available can follow cache clients?
this similar question: why connections azure redis cache high?
here best practices recommend customers:
- set abortconnect false in connection string
- create singleton connectionmultiplexer , reuse it. sufficient scenarios. advanced scenarios may require creating multiple connectionmultiplexer objects per application, fine one. recommend following coding pattern shown here: https://azure.microsoft.com/en-us/documentation/articles/cache-dotnet-how-to-use-azure-redis-cache/#connect-to-the-cache
- let connectionmultiplexer handle reconnecting - don't unless have tested code thoroughly. connection leaks have seen because people re-creating connectionmultiplexer fail dispose old one. in cases, best let multiplexer reconnecting.
Comments
Post a Comment