简体   繁体   English

ASP.Net应用程序在90秒后超时

[英]ASP.Net application gets timeout after 90 seconds

In my application I am fetching users details from almost 70 servers. 在我的应用程序中,我正在从将近70台服务器中获取用户详细信息。 This might take a max of 2 mins to fetch the details. 最多可能需要2分钟才能获取详细信息。 but when the application exceeds 90 sec the application times out. 但是当应用程序超过90秒时,应用程序将超时。 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. 我在配置文件中将执行超时设置为3600,如下所示。 but still it is getting Timed out in 90 secs. 但仍然会在90秒内超时。

<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. 使用此代码,您的应用程序将在20分钟后退出。

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. 同时,页面加载应进行AJAX调用以获取用户。

The second issue is that long running processes don't work so well with ASP.Net for a couple of reasons. 第二个问题是长期运行的进程在ASP.Net中不能很好地工作,原因有两个。 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. 否则,您需要将其推送到Windows服务中,并且网页应从Windows服务中请求它。 The ajax should poll the page every 1 to 2 seconds to see if it is done. Ajax应该每1到2秒轮询一次页面,看是否完成。 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. Windows服务完成工作后,应更新某些内容(可能是数据库表),然后将结果返回到AJAX中。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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