我在我们的应用程序中使用了单例 azure-redis 数据库客户端。但是在 Azure 门户上,它显示已连接的客户端 4.99K。我不确定这些客户是谁,为什么当我有单例实例时它显示 4.99K 客户已连接?
示例代码:
using StackExchange.Redis;
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
{
try
{
_cacheService = GetConnectionMultiplexer();
instance = _cacheService.GetDatabase();
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
}
}
}