从 inproc 切换到 SQL Server 会导致 SQL 超时(无连接最大池大小、类型化数据集)

发布于 2024-08-20 06:41:33 字数 1058 浏览 2 评论 0原文

这是我的情况:

我在 LAN 中有一个 Web 和数据库服务器(SQL Server 2005)。

Web 服务器(iis6)有几个应用程序池和站点,可以在 ASP.NET 会话 inproc 中正常运行。两台服务器都运行 win 2k3

现在我从 inproc 切换到 SQL Server,并且收到很多 SQL 超时过期消息。但仅限于将会话移至 SQL Server 的一个 Web 应用程序。所有其他网站不受影响。常规数据库查询会发生超时,但在使用 inproc 时运行良好。

我该如何解决这个问题?

提前致谢!

最好的问候,

JP

编辑:根据要求,我使用 SQL Server 的 Web 应用程序的 web.config:

<sessionState 
       mode="SQLServer" 
       timeout="60" sqlConnectionString="Data Source=192.168.1.80;Persist Security Info=True;User ID=aspstate;Password=state"
       />

我还忘记提及,带有 SQL Server 的问题网站与运行 inproc 的一个 Web 应用程序共享一个应用程序池。我只是将这两个网络应用程序拆分到它们自己的应用程序池中。但我认为这不会解决超时问题。奇怪的是,所有其他网站都保持正常运行

编辑2:今天,当我再次尝试从inproc切换到sqlserver时,我收到了此消息。作为数据访问,我使用大量类型化数据集 (*.xsd) 我的网络应用程序是一个电子商务网站,每天大约有 2000 个唯一访问者 这是消息:

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.

Here is my situation:

I have a web and database server (SQL Server 2005) in a LAN.

The webserver(iis6) has several application pools and sites run fine with asp.net session inproc. both servers run win 2k3

Now I switched from inproc to SQL Server and I get a lot of SQL timeout expired messages. But only from one web application that moved the sessions to SQL Server. All other websites are not affected. The timeouts occur on regular database queries which run fine when using inproc.

How do I troubleshoot this?

Thanks in advance!

best regards,

JP

edit: as requested my web.config of the web app which uses the SQL Server:

<sessionState 
       mode="SQLServer" 
       timeout="60" sqlConnectionString="Data Source=192.168.1.80;Persist Security Info=True;User ID=aspstate;Password=state"
       />

I also forgot to mention that the problem website with SQL Server shares an application pool with one web app which runs inproc. I just splitted the two web apps to their own app pools. But I don't think that that will resolve the timeouts. The strange thing is that all other websites stay running fine

edit 2: i have received this message today when i tried again to switch from inproc to sqlserver. as data access i use a lot of typed datasets (*.xsd) my web app is an e-commerce site which has about 2k unique visitors a day
here is the message:

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独岁月 2024-08-27 06:41:33

这听起来像是您的一个特定应用程序正在泄漏连接并填满 sql server 的连接池,从而导致超时。追踪这些问题可能会非常令人沮丧,请查看分析器应用程序和工具,例如 procexp

This sounds like your one specific application is leaking connections and filling up the connection pool for sql server resulting in the timeouts. Tracing these issues can be immensely frustrating, take a look at a profiler application and tools like procexp.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文