Solved

Timeout in SQLServer 2008

Posted on 2013-10-29
3
457 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 40

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
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.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

728 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