Solved

Timeout in SQLServer 2008

Posted on 2013-10-29
3
444 Views
Last Modified: 2013-11-04
Hello,

We didn't know that we have any kind of problem in our system related to the database.

But we have been analysing the timeout errors registered from the .NET aplication, we can see that sometimes the error "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding" happens in query's with an average response time of less than 100 miliseconds.
The timeout of the .NET connection is 60s.

So seems that we have a process that cause to colapse the system.

In order to get the guilty, we want to establish a timeout for the worker processes in SQL Server, in order that anyone that use more than 50 seconds, has to be killed.

Does somebody know how to fix in SQLServer a limit/timeout for querys/processes/jobs?

Thanks in advance,
0
Comment
Question by:Jaimesastre
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
virtuadept earned 500 total points
Comment Utility
This is a common problem. I do not know of any built in setting for this, but you can run DBA scripts that can do it.

Here is one that I found that attempts to send and email about the processes that will be killed before killing:

http://connectsql.blogspot.com/2012/09/sql-server-automatically-detect-and.html

Here is another one:

http://jasonhall.blogs.sqlsentry.net/2010/02/auto-kill-long-running-blocks-on-sql.html

These links have code examples and discussion about the issue.
0
 
LVL 39

Expert Comment

by:lcohan
Comment Utility
<<
In order to get the guilty, we want to establish a timeout for the worker processes in SQL Server, in order that anyone that use more than 50 seconds, has to be killed.

Does somebody know how to fix in SQLServer a limit/timeout for querys/processes/jobs?
>>


You can set the Query timeout in SQL SSMS Properties on the "Connections" option like in attached picture however...I would strongly advise to NOT do that on production servers as this can cause lots of data issues - as you can see the SQL default is 600 seconds or ten minutes.
SQLProperties.png
0
 
LVL 39

Expert Comment

by:lcohan
Comment Utility
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now