2

My site is running under IIS correctly. But after working for long time. It start giving the timeout error, seems like sever busy in doing other work. But the SQL server is running in my local host with no server usage/load except of the current application.

"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

After doing the system restart only i can resume my work. Need help on this. Thanks in advance

Sachin Kumar
  • 974
  • 2
  • 13
  • 23
  • 3
    Sounds like you have a leak somewhere. What is your site doing? Can you post code? – zimdanen May 07 '12 at 13:16
  • What are the resource utilization stats like when the box is working vs when it's timing out? Are you consuming large amounts of memory with the IIS server or the SQL Server? Is the processor pegged? – Mike Burton May 07 '12 at 13:55

3 Answers3

1

It sounds like you're hitting the execution timeout. If you're reaching this threshold, you may want to do some profiling to see if there's a performance bottleneck somewhere. To work around this issue, you can specify an execution timeout in the web.config:

<httpRuntime executionTimeout="180" /> <!-- in seconds -->

To change the execution timeout in SQL Server go to the server properties:

http://img197.imageshack.us/img197/3152/srvrprops.png

See here for more details:
Changing the CommandTimeout in SQL Management studio

Community
  • 1
  • 1
James Johnson
  • 45,496
  • 8
  • 73
  • 110
  • The HTTP runtime execution timeout has nothing to do with timeouts from SQL Server. Also, changing the execution time-out in SQL Server Management Studio will not affect SQL queries executed from outside Management Studio. This is purely a Management Studio setting and not a SQL Server setting. – Jakob Christensen May 07 '12 at 13:45
  • @JakobChristensen: Updated with illustration for setting the query timeout. – James Johnson May 07 '12 at 13:51
1

I have used the recompile to solve this issue.

EXEC sp_recompile N'myproc'
rahkim
  • 911
  • 2
  • 9
  • 17
0

Finally resolved this issue by clearing out the execution plan from the procedure cache.

To clear the plan cache run the following scripts...

SELECT plan_handle, st.text
FROM sys.dm_exec_cached_plans 
CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS st
where objtype = 'Proc' AND st.[text] like '%[Enter stored procedure name here]%'


If the stored procedure exists in the cache you're results should look like this:

results from execution plan query

From the results returned replace the plan_handle in the example below...

-- Remove the specific execution plan from the cache.  
DBCC FREEPROCCACHE (0x050017005CBF201940A1CE91000000000000000000000000);  
GO


More information here