I'm currently doing some GUI testing on a ASP.net 2.0 application. The RDBMS is SQL Server 2005. The host is Win Server 2003 / IIS 6.0.

I do not have the source code of the application because it was programmed by an external company who's not releasing the code.

I've noticed that the application performs well when I restart IIS but after some testing, after I have opened and closed my browser for a couple of hours, the application starts to get slower and slower. I was wondering if this behaviour was due to a bad closing connection practice from the programmers : I'm suspecting an open connection leak on the database here.

I guess the .Net garbage collector will eventually close them but... that can take a while, no?

I've got SQL Server Management Studio and I do notice from the activity monitor that there are quite a few connections opened on the database.

From all that's being said above, here are some questions related to the main question :

  1. Is there any way to know in SQL Server 2005 if connections are open because they're waiting to be used in a connection pool or if they're open because they are used by an application?

  2. Does somone know of good online/paper resources where I could learn how to use performance counters or some other kind of tools to help track down these kind of issues?

  3. If performance counters are the best solution, what are the variables that I should watch?

推荐答案

You can always check the connection strings from web.config (mainly if they have connection pooling activated, if they have any connection limits enabled).

Also, if you are using IIS 6, you could set your web application to use a separate Application pool, and set other option for the recycling of the memory and processes.

About the performance counters, you could check how long the garbage collector is running, how much memory the application is using, etc.

If you have access to sql server, you could monitor the connections made from your application (there are performance counters defined for every installed instance of SQL Server).

There were some articles in MSDN Magazine. Also you could use the SOS Debugging library to attach to the application's process and check it manually.

And, if you don't have the source code, try to use Reflector to get the sources of the application (they would be very usefull for debugging)

@Later edit:You could check this question here on stackoverflow.com too

Asp.net相关问答推荐

将 Response.Headers.Add 替换为方法属性decorator

什么是 SNIReadSyncOverAsync,为什么需要很长时间才能完成?

如何在 Javascript 中获取 C# 枚举

在 aspx 页面中使用 if else 和 eval

判断 asp.net mvc 4 应用程序中的 ssl 协议、密码和其他属性

捕获对 ASP.NET ASMX Web 服务的 SOAP 请求

ASP.NET:获取自 1970 年 1 月 1 日以来的毫秒数

解析器错误消息:文件/TestSite/Default.aspx.cs不存在

在 Blazor 中 Select 框绑定

发布发布事件

在 asp.net 中调整图像大小而不会丢失图像质量

如何使用 app_GlobalResource 或 app_LocalResource?

以编程方式从后面的代码中关闭 aspx 页面

在asp.net控件之间动态添加

使用 Ninject OWIN 中间件在 OWIN 启动中注入 UserStore

c# list 如何在两个值之间插入一个新值

GridView 按代码隐藏列

使用 ConfigurationManager.RefreshSection 重新加载配置而不重新启动应用程序

在 ASP.NET 中获取服务器的 IP 地址?

IE9 JavaScript 错误:SCRIPT5007:无法获取属性ui的值:对象为空或未定义