c# - 默认的 MaxPoolSize 是多少?

标签 c# sql-server

我遇到了可怕的错误:

Timeout expired. The timeout period elapsed prior to obtaining a connection from 
the pool. This may have occurred because all pooled connections were in use 
and max pool size was reached.

在 sql 中,我看到通过运行我只打开了 116 个连接:

SELECT 
    DB_NAME(dbid) as DBName, 
    COUNT(dbid) as NumberOfConnections,
    loginame as LoginName
FROM
    sys.sysprocesses
WHERE 
    dbid > 0
GROUP BY 
    dbid, loginame
;

116 似乎很低,我目前没有设置 MaxPoolSize。默认的 MaxPoolSize 是多少?

我还确保在完成后关闭所有连接。

最佳答案

From MSDN : 指定的最大池大小(默认值为 100)。

您遇到的是超时错误。它只表明它可能是由达到最大池大小引起的,但也可能是由于许多其他原因造成的。

关于c# - 默认的 MaxPoolSize 是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30331955/

相关文章:

c# - 点网核心 3.1 : How to use AddJsonFile with absolute path to file?

c# - 如何在文本框中只接受一位小数?

mysql - 将 MYSQL 转换为 MSSQL

sql - MS Sql Server 中的 Oracle "Dual"表相当于什么?

sql - varchar 与使用 (encryption_type = 'DETERMINISTIC' 加密) 的 varchar(50) 不兼容

c# - 获取 HMAC 的当前 MachineKey 或等效项(在 web-farm 中)

c# - 如何防止 Json.NET 将枚举转换为字符串?

c# - 向上转换为通用类型

sql-server - 无法连接到 Azure SQL Server。出现错误 "The Network path was not found"

sql-server - Microsoft Azure 门户中 SQL 数据库和 SQL Server 之间的区别