ASP. NET Timeout Problem rollup

Source: Internet
Author: User
Tags connectionstrings

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

Depending on the type of error, it is broadly divided into the following situations

1:asp.net Request timed out

2:iis Request timed out

3: Database connection timed out

4: Database operation timed out

5: Application pool Recycling (Low)

Service request timeout such as 6:webservice

7: Other reference URLs

The following are dealt with according to the above situation

1:asp.net Request timed out

HTTP request timeout can be globally configured in Webconfig (in seconds, default is 90 seconds) as follows

< system.web >   

< httpRuntime maxrequestlength="102400" executiontimeout=" /> "

</ system.web >  

2:iis Request timed out

Go directly to IIS to set up: iis-Web site-Properties set a larger value, but not too large, specific analysis of the situation.

3: Database connection timed out

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 timed out

Database operation Timeout There is no global setting method, only the CommandTimeout property of the command class (in seconds, the default is 30 seconds)

context.commandtimeout = N;

5: Application pool Recycling (bottom) This is a very low occurrence, please set

Application pools Recycle threads for a certain amount of time, directly set: Application Pools--Properties--Recycle worker processes

6:webservice and other service requests timeout (this is the solution provided by the reference network, I have not encountered)

Expands the time-out limit for the proxy class by default of 90 seconds, that is, specifying a time-out before calling the method.
[CSharp] Yourwebservice Yws = new Yourwebservice (); Yws. Timeout = 1200000; 20 minutes, Unit is milliseconds [/csharp]
If the Timeout property is set to Timeout.infinite, it indicates that the request has no time-out. Even if the XML Web Services client can set the Timeout property to no time-out, the Web server can still make the request time-out on the server side.

7: Other reference URLs

Some people say that setting the configuration of the Web. config for sessionstate node can also be resolved, if the solution cannot be solved as above, please refer to the following URL http://blog.sina.com.cn/s/blog_46682add0100axtf.html

ASP. NET Timeout Problem rollup

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.