sql server 快速查询超时
我 100% 确定这个问题是重复的,但我搜索了几个小时,但没有找到任何内容。
我的环境:windows server 2003、sql server 2005、.net 2.0 (c#)
我的问题:
当我同时运行 5 个请求时,我的存储过程之一引发超时。
如果,在 5 个请求等待期间,我在 Management Studio 中运行,我尝试使用相同的参数调用此存储过程,我会在 0 秒内得到结果:)
我尝试查看是否打开了太多连接,但我在活动监视器中看不到任何内容(我可以看到 14 个带有“等待命令”的项目)。
那么我的问题是什么?我认为这是一个配置丢失,如果是的话,你能解释一下我将如何选择这个配置的值吗?
谢谢
I'm 100% sure that this question is a duplicate but I searched for a few hours and I didn't find anything.
My environment : windows server 2003, sql server 2005 , .net 2.0 (c#)
My problem :
When I run 5 request in the same time , one of my stored proc raises a time-out.
If , during the period the 5 request are waiting, I run in Management Studio, I try to call this stored proc with the same argument, I get my results in 0sec :)
I tried to see if I have too much connection opened but I can't see anything in activity monitor (I can see 14 item with "awaiting command").
So what is my problem ? I think it's a configuration missing , if it is, can you explain me how I will choose the value of this configuration.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还可以尝试使用表提示更改 SP 中 select 语句的隔离级别。
例如:
还有其他几种隔离级别,但 READ UNCOMMITTED 是最低的,并且将从独占锁定的表中读取。缺点是你可能会得到脏读。
如果问题与锁定有关,这可能会有所帮助。
You can also try altering the isolation level of the select statement in the SP using a table hint.
For instance:
There are several other isolation levels but READ UNCOMMITTED is the lowest and will read from a table that is exclusively locked. The downside is you can get dirty reads.
If the issue is with locking, this might help.