我在Azure上使用StackExchange RedisCache,偶尔会在3或4秒后在GET期间超时。根据我的配置,我希望超时比这快得多。
private static Lazy<ConnectionMultiplexer> lazyConnection =
new Lazy<ConnectionMultiplexer>(() => {
string connectionString = "mycache.redis.cache.windows.net,abortConnect=false,ssl=true,password=...";
var options = ConfigurationOptions.Parse(connectionString);
options.SyncTimeout = 1000;
options.ConnectTimeout = 5000;
options.ResponseTimeout = 1000;
return ConnectionMultiplexer.Connect(options);
});
public static ConnectionMultiplexer Connection
{
get
{
return lazyConnection.Value;
}
}
是什么原因导致超时时间更长?