恢复与AWS的VPN连接后,RedisTimeoutException不会消失

时间:2019-07-17 14:59:46

标签: asp.net vpn stackexchange.redis amazon-elasticache

我有一个使用AWS托管的Elasticache Redis存储托管在数据中心的旧版应用程序。 AWS Redis通过VPN连接在数据中心内部连接/暴露-不幸的是,VPN有时会重新连接(每1-2天一次),并且发生这种情况时,StackExchangeRedis客户端中的一个 some 服务器将一直超时直到完成iisreset

异常消息:

Timeout performing SETEX (5000ms), inst: 3, qu: 0, qs: 1, aw: False, rs: ReadAsync,
ws: Idle, in: 0, in-pipe: 0, out-pipe: 0,
serverEndpoint: Unspecified/redis-prod.company-name.systems:6379,
mgr: 10 of 10 available, clientName: CNX-API07, PerfCounterHelperkeyHashSlot: 14646,
IOCP: (Busy=0,Free=1000,Min=24,Max=1000), WORKER: (Busy=14,Free=32753,Min=24,Max=32767),
v: 2.0.601.3402 (Please take a look at this article for some common client-side issues
that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)

Redis连接在应用程序启动时初始化一次:

public static Func<IPersistentStorage> GenerateCreator(string redisConfiguration)
{
    // this should only be called once
    var connection = ConnectionMultiplexer.Connect(redisConfiguration);

    return () => new RedisPersistentStorage(connection.GetDatabase());
}

我怀疑这可能是问题所在,即使这是文档中建议的方法:有时,VPN主机名redis-prod.company-name.systems后面的IP会在重新连接时发生更改,在这种情况下,Redis客户端似乎并没有注册。

那么:我的猜测是正确的,DNS解析的名称可能永远不会被StackExchangeRedis客户端刷新吗?如果是,我应该如何解决?公开Elasticache节点而不是负载均衡器会更好吗?

0 个答案:

没有答案