SQL Server 2016 timeout weird error

  • Dear All,

    I have a win form c# 4.5 app which connects to SQL server 2016 DB, most of the functions work correctly. For one of the functions, we make a simple 'select col1,col2 from table' query (datareader) we get below error

    Inner exception:: System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out.

    The same works fine on a different SQL server 2016 box, but does not on another Instance. I am trying to check what differences between the two boxes, since I do not have access to overall machine  - I am stuck.

    Can anyone guide, what settings on DB should be I be looking at?.

    I already compared:

    Connection timeout (same)

    Legacy cardinality estimation is ON

    re-index & update stats is done

    Any other pointers?

  • How long should the query take to run? Does it error straight away. I’d look at command timeout as well as connection.

    Is the Winforms app local (same machine) as the sql or remote. If remote, do more than one remote machine do this?

     

  • Box configuration is only part of the equation.  Workload is another big part.  Do you get the timeout on a machine with other queries being executed on it?  Have you looked at query activity when your SPID is trying to execute?

  • I got it resolved. This was the issue.

    Minimum Server Memory was set to 0. Max memory was set to default value (large value) 214.......

    OS was not getting enough memory, hence causing timeout.

    We set it as per below rules

    20% of memory for OS

    Remaining 80% divided among 5 SQL instances, set it to Max memory size.

    Minimum memory set to 4 GB

     

    • This reply was modified 4 years, 6 months ago by  GonnaCatchIT.
  • Nice!  Great job!!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply