asp.net various overtime problem Summary _ practical skills

Source: Internet
Author: User

In a database or request operation, if the selected time period is too short or the amount of data is too large, you will encounter the "Request Timeout" problem, the network provides a lot of solutions, but generally imperfect, according to personal experience and reference network solutions, the first summary of the following:

According to the type of error, the following are roughly divided into several cases
1:asp.net Request Timeout
2:iis Request Timeout
3: Database connection timeout
4: Database Operation timeout
5: Application pool Recycling (Low)
Service request timeout such as 6:webservice

The following are dealt with according to the above situation
1:asp.net Request Timeout
The HTTP request timeout can be configured globally in Webconfig (in seconds, default to 90 seconds) as follows
<system.web>
System.web>

2:iis Request Timeout
Go directly to IIS to set up: iis-Site-property to set a larger value, but not too large, specific case analysis.

3: Database connection timeout
Configure the database connection string together when configuring the
<connectionStrings>
<add name= "Marketingmate" connectionstring= "Data source=192.168.1.1; Database=marketingmate; User Id=sa; password=123; Connect timeout=30; Min Pool size=16; Max Pool size=100; "
Providername= "System.Data.SqlClient"/>
Connectionstrings>

4. Database Operation timeout
Database operation Timeout There is currently no global set method, you can only set the command class's CommandTimeout property (in seconds, default is 30 seconds)
Context.commandtimeout = 180;

5: Application pool Recycling (bottom) This appears to be very low, please set up as appropriate
The application pool will recycle threads within a certain amount of time, set directly: Application Pool--Properties--Reclaim worker processes

6:webservice Service Request Timeout (this is a reference to provide online solutions, I have not encountered)
Enlarges the proxy class time-out limit, which defaults to 90 seconds, which specifies the timeout before calling the method.
[CSharp] Yourwebservice Yws = new Yourwebservice (); Yws. Timeout = 1200000; 20 minutes, Unit is milliseconds [/csharp]
Setting the Timeout property to Timeout.infinite indicates that the request has no time-out. Even if the XML Web Services client can set the Timeout property to No timeout, the WEB server can still cause the request to timeout on the server side.

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.