dotnet/aspnetcore

SQL Server Distributed Cache Extensions suffering significant performance issues

Open

#28,366 创建于 2020年11月19日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)C# (10,653 fork)batch import
area-middlewarefeature-cachinghelp wanted

仓库指标

Star
 (37,933 star)
PR 合并指标
 (平均合并 16天 9小时) (30 天内合并 258 个 PR)

描述

Describe the bug

Serious performance issues when reading binary values, when using SQL Server Distributed Cache extension.

To Reproduce

Using SQL Server Distributed Cache, persist a value with an arbitrary value of 15MB. Access the data using the async read operations. Note this takes approximately 15 seconds in our environment.

Expected behavior

This should take milliseconds.

Additional context

I suspect this is caused by an open SQL Client bug mentioned below. Can you please verify if this is the case? Is there a work-around that can be implemented in DatabaseOperations until this is resolved?

https://github.com/dotnet/extensions/blob/master/src/Caching/SqlServer/src/DatabaseOperations.cs, line 229 value = reader.GetFieldValue<byte[]>(Columns.Indexes.CacheItemValueIndex);

Reading binary data asynchronously is extremely slow https://github.com/dotnet/SqlClient/issues/593

It looks like the SqlClient team are suggesting people use the StreamAsync operation as a work-around?

One reasonably successful work-around we have tried is to increase the TDS Packet Size up to 32,767. What are your thoughts on this?

贡献者指南