我在我的Azure网站上得到了下面的错误,我正在争先恐后地修复它:
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. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: 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.
我怎样才能重置池或增加它?
您可以在Azure中增加SQL连接池,与其他任何数据库一样。 默认你有100个连接。 如果您的系统上没有这么多用户,则可能需要检查您是否正在closures/处理不再使用的连接。
connectionString="Server=XXX;Database=XXX;User Id=XXX;password=XXX; connection timeout=0;Max Pool Size = 500;Pooling = True"
您可以运行启动命令来更改应用程序池空闲超时。 从一个启动任务调用的cmd文件中运行这样的东西(这个例子禁用超时):
%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.processModel.idleTimeout:00:00:00
使用类似的技术,您可以在达到特定内存阈值后回收应用程序池(请参阅本文 )
调整您的web.config以匹配您当前的Azure SQL数据库层最大连接
有关每个层限制的更多信息,请访问: https : //azure.microsoft.com/zh-CN/documentation/articles/sql-database-resource-limits/