Solved

Timeout in SQLServer 2008

Posted on 2013-10-29
3
449 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
ID: 39609032
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
ID: 39609169
<<
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
ID: 39609177
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

809 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