我的应用程序是在经典的 asp 上开发的,但在我在 .Net 上迁移应用程序时也使用 asp.net.它使用 SQL Server 作为数据库并托管在 Windows Server 2003 上.
my application is developed on classic asp, but also uses asp.net as I am migrating the application on .Net. Its using SQL server as database and hosted on Windows server 2003.
现在的问题是应用程序在很长一段时间内都可以正常工作,但一段时间后 SQL 服务器会出现超时错误,它可以完成任何请求.即使我重新启动我的 SQL 服务器甚至 IIS,它也没有得到修复,最终我每次都必须重新启动我的服务器,这只能解决问题.
Now the problem is that the application continue to work perfectly fine for a long time but then after some time SQL server gives timeout error and it could fulfill any of the requests made. It doesn't get fixed even when I restart my SQL server or even IIS, ultimately I have to restart my server every time which only fixes the problem.
知道可能导致问题的原因吗?粗略地说,该网站在高峰时段有大约 300 人使用.
Any idea what might be causing the problem? Just to give a rought idea, the site is used by around 300 people at peak times.
知道可能导致问题的原因吗?粗略地说,该网站在高峰时段被大约 300 人使用.我肯定会在任何地方关闭连接,每个页面上的结束代码都会关闭连接.如果在结束页面之前发生错误,期望处理程序将关闭连接.所以我确信关闭连接不是问题.如果我看到 sql 日志,则没有打开的连接.我们的服务器,只有一个盒子,有SQL Server、IIS、iMail(我们的邮件服务器).在我重新启动 SQL Server 后,它并没有解决问题.只需重新启动 Windows Server,它就可以工作.从性能来看,IO 使用率相当高.有什么建议吗?
Any idea what might be causing the problem? Just to give a rought idea, the site is used by around 300 people at peak times. I am certainely closing connection everywhere, my end code on each page closes the connection. If an error occurs before the end page, the expection handler closes the connection. So I am sure that closing the connection isn't an issue. And that there are no open connection if I see the sql logs. Our server, only one box, has SQL Server, IIS, iMail (our mail server). After I had restarted SQL Server, it did not solve the problem. Only restarting Windows Server, it worked. From perfom, IO usage is quite high. Is there any suggestions?
谢谢,
听起来很像是有某种非托管资源您没有正确清理.我们没有足够的信息来确切地知道该资源可能是什么,所以我们只能猜测.
It sounds a lot like there's an unmanaged resource of some kind that you aren't cleaning up properly. We don't have enough information to know exactly what that resource might be, so all we can do is guess.
我的第一直觉是数据库连接,但如果是这种情况,重新启动那个重新启动的 sql server 应该可以修复它.列表中的下一个是文件句柄和线程,因此,如果您执行任何多线程工作或额外的文件 io,那将是值得一看的.请记住,在 ASP.Net 中,using
语句(不是指令)是您的朋友.
My first instinct is database connections, except that restarting that restarting sql server should fix it if that were the case. Next on the list is file handles and threads, so if you do any multithreading work or extra file io that would be something to look at. Remember, in ASP.Net, the using
statement (not directive) is your friend.
这篇关于SQL 服务器超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!