ODBC具有SetRowsetSize,ADO.net中的等效项是什么? [英] ODBC has SetRowsetSize, what is the equivalent in ADO.net?

查看:148
本文介绍了ODBC具有SetRowsetSize,ADO.net中的等效项是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找处理高延迟连接的方法。 ODBC具有 SetRowsetSize 可以解决此问题,如此处此处



在ADO.net中是否具有与该设置等效的功能? 本文似乎暗示



通常来说,如何提高ADO.net中的高延迟连接性能?



解决方案

如果您担心将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.net? 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.net 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中的等效项是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆