如何解决负载下的Azure Redis超时
我已经按照自述文件中所述完全实现了EF Core this二级缓存。今晚,我在具有约500个虚拟用户的系统上进行了负载测试,并且出现了如下所示的大量超时:
Azure Redis Premium 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,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;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。