Redis缓存超时

时间:2019-04-05 21:02:53

标签: redis stackexchange.redis azure-redis-cache

我在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;
        }
    }

是什么原因导致超时时间更长?

0 个答案:

没有答案