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

时间:2021-06-21 15:30:10

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)

在我的应用程序中,我从近70台服务器获取用户详细信息。这可能需要最多2分钟才能获取详细信息。但是当应用程序超过90秒时,应用程序会超时。除了我在左下角收到超时异常(浏览器中的警告消息)之外,屏幕没有变化

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

我在配置文件中将执行超时设置为3600,如下所示。但它仍然在90秒内超时。

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

Please help me resolving this issue. Thanks in advance

请帮我解决这个问题。提前致谢

3 个解决方案

#1


1  

try this

尝试这个

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

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

使用此代码,您的应用程序将在20分钟后退出。

#2


0  

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. 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.

第二个问题是,由于几个原因,长时间运行的进程与ASP.Net不能很好地协同工作。其中之一是应用程序池每隔一段时间就会循环中止所有线程。你可能不会为此烦恼,但偶尔你会失败。否则,您需要将其推送到Windows服务中,并且网页应该从Windows服务请求它。 ajax应每隔1到2秒轮询页面以查看是否已完成。一旦Windows服务完成工作,它应该更新一些东西(可能是数据库表),然后在AJAX中返回结果。

#3


0  

I had same issue and had to increase timeout (default of 90 seconds) to the scriptmanager AsyncPostBackTimeout="1200"

我有同样的问题,不得不增加超时(默认为90秒)到scriptmanager AsyncPostBackTimeout =“1200”

#1


1  

try this

尝试这个

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

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

使用此代码,您的应用程序将在20分钟后退出。

#2


0  

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. 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.

第二个问题是,由于几个原因,长时间运行的进程与ASP.Net不能很好地协同工作。其中之一是应用程序池每隔一段时间就会循环中止所有线程。你可能不会为此烦恼,但偶尔你会失败。否则,您需要将其推送到Windows服务中,并且网页应该从Windows服务请求它。 ajax应每隔1到2秒轮询页面以查看是否已完成。一旦Windows服务完成工作,它应该更新一些东西(可能是数据库表),然后在AJAX中返回结果。

#3


0  

I had same issue and had to increase timeout (default of 90 seconds) to the scriptmanager AsyncPostBackTimeout="1200"

我有同样的问题,不得不增加超时(默认为90秒)到scriptmanager AsyncPostBackTimeout =“1200”