我正在寻找处理高延迟连接的方法。 ODBC具有 SetRowsetSize 可以解决此问题,如此处和此处。
在ADO中是否具有与该设置等效的功能? 本文似乎暗示
通常来说,如何提高ADO中的高延迟连接性能?
?
解决方案如果您担心将ADO.NET与SQL Server一起使用时的延迟,则应研究连接池。尽管请注意池碎片。
连接到数据源可能很耗时。为了最小化打开连接的成本,ADO.NET使用了一种称为连接池的优化技术,它使重复的打开和关闭连接的成本最小化。对于.NET Framework数据提供程序,连接池的处理方式有所不同。
此外,如果您需要快速检索许多记录,请使用 SqlDataReader 。与使用其他类型的ADO.NET对象(如数据集)相比,它所需的内存要少得多,并且已对其进行了优化以有效地获取大量数据。
有某些性能计数器,您可以查看它的数量活动连接池( NumberOfActiveConnectionPools )以及其他有用信息。
逐步测试指南。
I am looking for ways to deal with a high latency connection. ODBC has a SetRowsetSize that solves this problem, as described here and here.
Is there an equivalent of this setting in ADO? This article seems to suggest there is an analog in the original ADO, but it is very old and points to articles that no longer exist.
Generally speaking, how does one improve performance in ADO for high-latency connections?
解决方案If you are concerned about latency while using ADO.NET with SQL Server, you should to look into connection pooling. Though be mindful of pool fragmentation.
Connecting to a data source can be time consuming. To minimize the cost of opening connections, ADO.NET uses an optimization technique called connection pooling, which minimizes the cost of repeatedly opening and closing connections. Connection pooling is handled differently for the .NET Framework data providers.
Additionally, if you need to retrieve many records rapidly, look into using the SqlDataReader. It requires significantly less memory than a using other types of ADO.NET objects like DataSets and its optimized for efficiently fetching large amounts of data.
There are certain performance counters you can look at to see the number of active connection pools (NumberOfActiveConnectionPools) along with other useful information.
Step by step guide on how to test.
更多推荐
ODBC具有SetRowsetSize,ADO.net中的等效项是什么?
发布评论