Sysprocesses表-它可以帮助我调试连接池问题吗? [英] Sysprocesses table - will it help me debug connection pooling issues?

查看:98
本文介绍了Sysprocesses表-它可以帮助我调试连接池问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows服务,该服务定期(每10秒)执行很多数据库活动。我已验证所有连接均已关闭(使用)。一段时间(几天或几小时)后,我收到此错误:

I've got a windows service that regulary (every 10 sec) does a lot of db activity. I've verified that all my connections are closed (using using). After some time (days or hours) I get this error:


超时已过期。从池中获得
连接之前,超时时间已过去。这可能是因为所有池化的
连接都在使用中,并且达到了最大池大小。

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

我发现我应该检查sysprocesses表,发现在运行代码时它正在创建很多新条目(而且我确实确定要关闭连接)

I found that I should check the sysprocesses table, and found that it is creating lots of new entries when my code is run (and I'm really sure I'm closing the connection)

问题是:就我而言,如果同一位用户遍历相同的查询,那么服务中几乎每个刻度都应该有一个新条目吗?其他服务没有这种行为。

Question is: In my case, where it is the same user doing the same queries all over, should there be a new entry for almost every tick in the service? Other services does not have this behaviour.

或者可能是在sysprocesses表中查找,没有提供任何有用的信息?

Or is maybe looking in the sysprocesses table not giving me any useful info?

Larsi

推荐答案

sysprocesses已过时,因此,如果您使用的是2005+版本,请使用sys.dm_exec_requests,sys.dm_exec_connections和sys .dm_exec_session。

sysprocesses is deprecated so if you're on 2005+ use sys.dm_exec_requests, sys.dm_exec_connections and sys.dm_exec_session.

这将为您提供有关连接的更好信息。

that'll give you better info about your connections.

这篇关于Sysprocesses表-它可以帮助我调试连接池问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆