代码之家  ›  专栏  ›  技术社区  ›  Chris Kooken

Azure Redis加载超时

  •  0
  • Chris Kooken  · 技术社区  · 4 年前

    this EF核心的二级缓存完全如自述文件中所述。今晚,我对大约500个虚拟用户的系统进行了负载测试,我得到了很多超时,如下所示:

    Azure Redis高级6 GB

    Message: Timeout performing GET (5000ms), next: GET 8664A5E9, inst: 51, qu: 0, qs: 101, aw: False, rs: ReadAsync, ws: Idle, in: 65536, serverEndpoint: xxxxx.redis.cache.windows.net:6380, mc: 1/1/0, mgr: 10 of 10 available, clientName: RD2818785C3C7F, IOCP: (Busy=6,Free=994,Min=4,Max=1000), WORKER: (Busy=63,Free=8128,Min=4,Max=8191), v: 2.1.58.34321 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)
    

    相关启动代码

            const string providerName1 = "Redis1";
            services.AddEFSecondLevelCache(options =>
                    options.UseEasyCachingCoreProvider(providerName1, CacheExpirationMode.Absolute, TimeSpan.FromMinutes(5)).DisableLogging(true)
            );
    
            ConnectionMultiplexer.SetFeatureFlag("preventthreadtheft", true);
    
            services.AddEasyCaching(option => {
                option.UseRedis(config => {
                    config.DBConfig.Configuration = AppConfig.RedisConnectionString;
                    config.DBConfig.AllowAdmin = true;                    
                }, providerName1);
            });
    
        private DbContextOptionsBuilder<DBContext[![enter image description here][2]][2]> GetDBConfig(IContext context) {
            var optionsBuilder = new DbContextOptionsBuilder<DBContext>();
            optionsBuilder.UseSqlServer(AppConfig.DatabaseConnection)
            .AddInterceptors(context.GetInstance<SecondLevelCacheInterceptor>())
            //.UseLoggerFactory()
            .EnableSensitiveDataLogging(true);
            return optionsBuilder;
        }
    

    enter image description here

    0 回复  |  直到 4 年前