简体   繁体   中英

ASP.Net application gets timeout after 90 seconds

In my application I am fetching users details from almost 70 servers. This might take a max of 2 mins to fetch the details. but when the application exceeds 90 sec the application times out. there is no change in the screen except i am getting the timeout exception in the bottom Left corner(the alert message in the browser)

I have set execution timeout to 3600 in config file as below. but still it is getting Timed out in 90 secs.

<httpRuntime maxRequestLength="2147483647" executionTimeout="3600"/>

Please help me resolving this issue. Thanks in advance

try this

<configuration>
 <system.web>
  <sessionState timeout="20"></sessionState>
 </system.web>
</configuration>

Using this code, your application will sign out after 20 minute.

There are two issues here as far as I can see. The first is the actual page render. You should consider loading the page once and that fires something to go fetch your users. In the mean time the page was loaded should make AJAX calls to fetch the users.

The second issue is that long running processes don't work so well with ASP.Net for a couple of reasons. One of them is that the application pool recycles every so often aborting all threads. You could just not bother with this but every now and then you will get a failure. Otherwise you need to push that into a windows services and the web page should request it from the windows service. The ajax should poll the page every 1 to 2 seconds to see if it is done. Once the windows service has finished the work it should update something (maybe a database table) and then you return the result in the AJAX.

我遇到了同样的问题,不得不将超时(默认为90秒)增加到脚本管理器AsyncPostBackTimeout =“ 1200”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM