The wait operation timed out. ASP

后端 未结 5 2023
不思量自难忘°
不思量自难忘° 2020-12-29 07:40

I created an internal website for our company. It run smoothly for several months and then I made a major update due to user suggestion. When I run in live, it run normally.

相关标签:
5条回答
  • 2020-12-29 08:06

    Remember to increase the connection timeout AND the command timeout:

    SqlConnection(@"Data Source=SQLSERVER;Initial Catalog=MYCATALOG;Integrated Security=True;Connection Timeout=1000");//huge timeout
    

    and then:

    com.CommandTimeout = 950;//or whatever
    
    0 讨论(0)
  • 2020-12-29 08:09

    I fixed this error by finding the exact procedure in event viewer where timeout was happening.

    Connected to the same Database in SSMS and ran:

    exec sp_recompile 'Procedure name'
    

    It showed the below message:

    Object 'Procedure name' was successfully marked for recompilation.

    0 讨论(0)
  • 2020-12-29 08:17

    It can also be another issue. For instance, if you run a lot of queries during one connection opened and it exceeds the connection lifetime. Then you need to set Connection Lifetime property in your connection string. Here is the description:

    When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by Connection Lifetime. This is useful in clustered configurations to force load balancing between a running server and a server just brought online. A value of zero (0) causes pooled connections to have the maximum connection timeout.

    0 讨论(0)
  • 2020-12-29 08:19

    In the web.config file go to connections String and add this: ;Integrated Security=True;Connect Timeout=120"

    0 讨论(0)
  • 2020-12-29 08:20

    If you found the exact error "The wait operation timed out" then it is likely you have a database call that took longer than expected. This could be due to any number of things:

    1. Transient network problem
    2. High SQL server load
    3. Problem with SAN, RAID, or storage device
    4. Deadlock or other form of multiprocess contention

    You haven't shared enough information to troubleshoot. The way I would manage this would be to check for other occurrences of the problem and see if there is a pattern, e.g. if the problem occurs at a certain time of day.

    Certainly increasing the timeout is not a bad idea (if it is currently set pretty low) and may resolve the problem in and of itself.

    0 讨论(0)
提交回复
热议问题