21

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!

sachaa
  • 1,977
  • 3
  • 18
  • 26
  • What kind of web service?? ASP.NET/ASMX, or WCF ?? ASMX is typically handled in code, unless you've specifically done something to be able to specify the timeout in config; WCF is config for just about everything.... – marc_s May 26 '10 at 16:07
  • The remote web services is indeed a ASP.NET ASMX web service. As I mentioned before I'm not able to change code in my app (since I only have the binaries). – sachaa May 26 '10 at 16:13
  • If you only have the binaries, decompile them with .NET Reflector to see what's going on under the hood to at least give you some clues. You can configure the session timeout in the web.config (not sure if that's the timeout you mean) – nickytonline May 26 '10 at 19:45
  • Thanks nickyt. The session timeout would affect the client side of the web service connection or the server side? I have already increased the server side editing the web.config but my question is how can increase the wait time of the client side of the web service (which also happens to be a web application). – sachaa May 28 '10 at 15:15

3 Answers3

28

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

Thea
  • 7,879
  • 6
  • 28
  • 40
5

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.

TheTechGuy
  • 16,560
  • 16
  • 115
  • 136
  • I +1'd this because far too often a young developer will run straight to the Timeout Pump. When in actuality, a heavy call like Regex or an SQL Query not using indexed fields or something are the problem. Always first assume that the Timout is far long enough, and that it's being run-over because something could be optimized in code. Only as an educated design decision should executionTimeout be increased. – Suamere Feb 11 '14 at 04:19
  • 1
    My timeout was caused by a query that took 1 minute 43 seconds, written by a colleague. There were so many complex subclauses and selects from selects that I was afraid to touch it. But I pulled one clause into a temp table and ran a LEFT( , LEN(REPLACE(....))) query on the temp table instead of on a subclause of the query. Then I joined the query to the temp table. Execution time: down to 2 seconds. Took about half an hour. [Blows on fingers]. – Resource Sep 21 '15 at 15:44
  • 1
    In the .NET Framework 1.0 and 1.1, the default is 90 seconds. Starting with .NET 2.0 the default is 110 seconds (1 minute 50 seconds). https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.100).aspx – Only You Mar 21 '18 at 16:13
0

In web.config file

<binding name="endpointname" sendTimeout="00:3:00" />

This will update timeout property to 3 minutes

Hisham Shahid
  • 225
  • 3
  • 7