V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
tututututututu
V2EX  ›  SQL Server

在.Net 中 是否有第三方实现 Sqlserver 客户端连接池的 SDK

  •  
  •   tututututututu · 2023-04-13 17:24:05 +08:00 · 1200 次点击
    这是一个创建于 588 天前的主题,其中的信息可能已经有所发展或是发生改变。

    需求:在.Net 中我想有一个连接池并且使连接一直处于被打开状态,比如我有 100 个已经被打开的连接,这样流量过来的时候就不需要新创建 SqlConnection 然后再 Open(这个操作 Latency 太高了),有类似实现的 SDK 嘛

    2 条回复    2023-04-15 21:33:11 +08:00
    jtwor
        1
    jtwor  
       2023-04-13 17:29:49 +08:00
    forgottencoast
        2
    forgottencoast  
       2023-04-15 21:33:11 +08:00
    连接池是内置的,你只需要根据你的需求进行配置就可以了。
    详见: https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql-server-connection-pooling
    Connection pooling reduces the number of times that new connections must be opened. The pooler maintains ownership of the physical connection. It manages connections by keeping alive a set of active connections for each given connection configuration. Whenever a user calls Open on a connection, the pooler looks for an available connection in the pool. If a pooled connection is available, it returns it to the caller instead of opening a new connection. When the application calls Close on the connection, the pooler returns it to the pooled set of active connections instead of closing it. Once the connection is returned to the pool, it is ready to be reused on the next Open call.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3260 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 12:10 · PVG 20:10 · LAX 04:10 · JFK 07:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.