Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase the timeout to a web service request?

Tags:

I have an ASP.NET web application that I can't modify (I only have the binaries). This application connects to a web service and it seems like the connection is closed from the client side (my web app). I have increased the "executionTimeout" in the machine.config of the destination server but my web app seems to still stop after waiting for a while.

Is there a way to increase the timeout time for my web application by simply modifying the web.config? As I said... I can't modify the timeout in the code so my only option would be through config files.

Thanks!

like image 324
sachaa Avatar asked May 26 '10 16:05

sachaa


People also ask

How do I set HTTP request timeout?

Timeouts on http. request() takes a timeout option. Its documentation says: timeout <number> : A number specifying the socket timeout in milliseconds. This will set the timeout before the socket is connected.

How do I increase HTTP request timeout in IIS?

Expand the local computer node, expand "Web Sites", right-click the appropriate website, and then click Properties. 3. Click the "Web Site" tab. 4.In the Connections area, change the value in the "Connection timeout" field, and then click OK.


2 Answers

Try if this would work for you.

Firstly, you need to increase the timeout of the executionTimeout attribute of the httpRuntime element. Note that this is mentioned in Seconds unlike the other timeout attributes like the Session timeout and others.

<httpRuntime      executionTimeout="36000" 

And moreover, this attribute takes effect only when you set the debug attribute of the Compilation element to false. This is also specified in the MSDN link that you mentioned. Like,

<compilation     debug="false"  ../> 

But this works in conjunction with the Session timeout. Yes, if the session times out , then an error would be thrown. and it wouldn't wait for the executionTimeout value to take effect. so you also need to set the Session Timeout to a higher value. And note that this is in minutes. which would look like,

<sessionState      mode="InProc"      timeout="360"     ...     /> 

And note that all of this would be overriden by AppPool recycling process. so you need to set the Idle Timeout value of the Apppool that your website uses to atleast same / higher value than the session timeout.

I found it here http://www.eggheadcafe.com/community/aspnet/17/10111748/how-can-we-increase-the-t.aspx

like image 151
Thea Avatar answered Oct 15 '22 01:10

Thea


The default timeout of web application is 90 seconds which is usually more than enough for general purpose use. It is important to note where the timeout is coming from. Is it from the page itself or something in the page that is causing it. In either case, it would appear that the "the page" is timing out.

I stumbled upon this question as my page was timing out too. Found out the exception was coming from SQL (read the the actual error) so it was really SQL problem. Once I knew it, I could easily fix it.

like image 45
Hammad Khan Avatar answered Oct 15 '22 03:10

Hammad Khan