The timeout has reached. The timeout time has expired or the server has not responded before the operation is completed.

Source: Internet
Author: User

One day, the business system reached 0.15 million data records. The customer reported that the database could not be connected in about one hour, and ms SQL Server needs to be restarted to restore normal. The following error was found after Error Tracking:

 

 

A server error occurs in the "/XXX" application.

The timeout has reached. The timeout has expired or the server has not responded before the operation is completed.

Note:An error occurred while executing the current Web request. Check the stack trace information for details about the error and the source of the error in the code.

Exception details:System. Data. SqlClient. SqlException: the timeout has been reached. The timeout has expired or the server has not responded before the operation is completed.

Source error:

Row 71: Row 72: Row 73: DataSet ds = db. executeDataSet (dbCommand); line 74: if (int. tryParse (db. getParameterValue (dbCommand, "TotalPage "). toString (), out result) Row 75: TotalPage = (int) db. getParameterValue (dbCommand, "TotalPage ");

Source file:XXX. DAL \ Pager \ DataPager. csRow:73

Stack trace:

[SqlException (0x80131904): the timeout has reached. The timeout time has elapsed before the operation is completed or the server has not responded.] System. data. sqlClient. sqlConnection. onError (SqlException exception, Boolean breakConnection) + 1950890 System. data. sqlClient. sqlInternalConnection. onError (SqlException exception, Boolean breakConnection) + 4846875 System. data. sqlClient. tdsParser. throwExceptionAndWarning (TdsParserStateObject stateObj) + 194 System. data. sqlClient. tdsParser. run (RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) + 2392 System. data. sqlClient. sqlDataReader. consumeMetaData () + 33 System. data. sqlClient. sqlDataReader. get_MetaData () + 83 System. data. sqlClient. sqlCommand. finishExecuteReader (SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) + 297 System. data. sqlClient. sqlCommand. runExecuteReaderTds (CommandBehavior describehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) + 954 System. data. sqlClient. sqlCommand. runExecuteReader (CommandBehavior describehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) + 162 System. data. sqlClient. sqlCommand. runExecuteReader (CommandBehavior describehavior, RunBehavior runBehavior, Boolean returnStream, String method) + 32 System. data. sqlClient. sqlCommand. executeReader (CommandBehavior behavior, String method) + 141 System. data. sqlClient. sqlCommand. executeDbDataReader (CommandBehavior behavior) + 12 System. data. common. dbCommand. system. data. IDbCommand. executeReader (CommandBehavior behavior) + 10 System. data. common. dbDataAdapter. fillInternal (DataSet dataset, able [] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) + 130 System. data. common. dbDataAdapter. fill (DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) + 287 System. data. common. dbDataAdapter. fill (DataSet dataSet) + 94 Microsoft. practices. enterpriseLibrary. data. database. doLoadDataSet (DbCommand command, DataSet dataSet, String [] tableNames) + 865 Microsoft. practices. enterpriseLibrary. data. database. loadDataSet (DbCommand command, DataSet dataSet, String [] tableNames) + 110 Microsoft. practices. enterpriseLibrary. data. database. loadDataSet (DbCommand command, DataSet dataSet, String tableName) + 103 Microsoft. practices. enterpriseLibrary. data. database. executeDataSet (DbCommand command) + 111. DAL. pager. dataPager. getPager2005 (String TableName, String Fields, String OrderField, String sqlWhere, Int32 PageSize, Int32 PageIndex, Int32 & TotalPage) in E: \ Works \ Source \\. DAL \ Pager \ DataPager. cs: 73. BLL. pager. dataPager. getPager2005 (String TableName, String Fields, String OrderField, String sqlWhere, Int32 PageSize, Int32 PageIndex, Int32 & TotalPage) in E: \ Works \ Source \\. BLL \ Pager \ DataPager. cs: 44 Retiree_RetireeInfoSearchResult.BindGridView (String strWhere, Boolean isBind) in e: \ Works \ Source \\. webUI \ Retiree \ RetireeInfoSearchResult. aspx. cs: 254 Retiree_RetireeInfoSearchResult.aspnetPager_PageChanged (Object src, EventArgs e) in e: \ Works \ Source \\. webUI \ Retiree \ RetireeInfoSearchResult. aspx. cs: 272 Wuqi. webdiyer. aspNetPager. onPageChanged (EventArgs e) + 97 Wuqi. webdiyer. aspNetPager. onPageChanging (PageChangingEventArgs e) + 191 Wuqi. webdiyer. aspNetPager. raisePostBackEvent (String args) + 155 System. web. UI. page. raisePostBackEvent (IPostBackEventHandler sourceControl, String eventArgument) + 13 System. web. UI. page. raisePostBackEvent (NameValueCollection postData) + 175 System. web. UI. page. processRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) + 1565

Version:Microsoft. NET Framework Version: 2.0.50727.3634; ASP. NET version: 2.0.50727.3634

 

 

 

Problem Analysis:

1. A large amount of data, a large number of users at the same time, a large number of requests, and the existence of multiple application systems at the same time lead to a high load on the server;

2. Program problems, no attention to optimization, or lead to an endless loop

3. database configuration problems

4. IIS or program configuration problems

 

Solution:

1. Modify the web. config Configuration

Join

Pooling = True; Max Pool Size = 512

 

2. Modify SQL Server configurations

Modify the connection limit in server properties and set the remote query timeout value to 0.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.