Are SQL Server timeouts logged?

2019-03-25 00:58发布

Are SQL Server timeouts (SELECT queries, in particular) logged in the ERRORLOG file?

Background is a customer with a web site having occasional "Request timeout" messages, looking to me assuming that the timeout is caused by a database timeout. There are no timeout errors in the ERRORLOG in question.

3条回答
祖国的老花朵
2楼-- · 2019-03-25 01:11

No. You will need to use SQL Profiler. A standard trace with the Lock Timeout event and Deadlock Graph events should do it.

Hardware aside (such as enough RAM and fast drives, and appropriate placement of Data and Log files on the appropriate RAID configurations) most timeouts are caused by not having a sufficently 'good' set of indexes for your workload.

Do you have index maintenance plans scheduled regularly?

查看更多
女痞
3楼-- · 2019-03-25 01:28

you could also use Event Noifications that get rased on the timeout and deadlock events. after it fires you can write it to a table and or send yourself an email. i've shown the general technique here: http://weblogs.sqlteam.com/mladenp/archive/2008/07/18/Immediate-deadlock-notifications-without-changing-existing-code.aspx

this way you don't have to run profiler which can impact performance.

查看更多
姐就是有狂的资本
4楼-- · 2019-03-25 01:29

SQL Server timeouts are initiated from the client-side as Attention Events and are not recorded in the SQL Server Error Log.

You can monitor for Attention Events using:

查看更多
登录 后发表回答