3

I have an ASP.NET application running on IIS 8.5 that times out at 60 seconds regardless of what I set. In other words, I can set the connection timeout to 300 seconds or 30 seconds and the page will still time out at 60 seconds. The Request status code is 504 GATEWAY_TIMEOUT.

Site:

  • Connection timeout = 300 seconds (5 mins)
  • Session timeout = 20 minutes
  • Script timeout = 10 minutes

App Pool:

  • .NET CLR v4.0
  • Integrated pipeline
  • 64-bit (32-bit not allowed)
  • Idle timeout = 20 mins (default)

Other things I've done:

  • Read just about every article I can on this subject
  • Set the executionTimeout in my web.config
  • Restarted the site or ran iisreset after each change
  • Disabled all sites except this one to isolate it
  • Created a simple ASPX page in which I set a Sleep thread to under or over 60 seconds, and tried every combination with the connection timeout value.

I'm at a loss. Any ideas?

Opus4210
  • 83
  • 1
  • 6

2 Answers2

5

The answer turned out to be a load balancer, which I was unaware existed, that had its own timeout setting.

Opus4210
  • 83
  • 1
  • 6
  • 3
    Same happen on my case, I had an AWS load balancer with 60 seconds idle timeout. – deerdeer Jan 16 '20 at 21:11
  • I may cry. worked on this 100 hours and some AWS angels came and increased the 60s timeout and it worked!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! – Poat Feb 06 '22 at 02:01
1

Check your maxRequestLength, apparently that can cause a 504 if the incoming request exceeds the default limit of 4MB.

504 Error On Server

Can big ViewState content result a HTTP Error 504 - Gateway timeout?

drone6502
  • 433
  • 2
  • 7
  • Thanks for the reply. This isn't the issue because the problem happens with the test app that I mentioned above, which has a request length of only a couple of K. – Opus4210 Nov 09 '17 at 18:25
  • It takes longer than 60 seconds to send a few kilobytes? Are you using a dial-up connection? – drone6502 Nov 09 '17 at 18:29
  • No, the test is purposely creating the delay of 60+ seconds with a Sleep thread. – Opus4210 Nov 09 '17 at 19:10