如何在IIS上运行应用程序池无限时间? [英] How to run application pool infinite time on IIS?

查看:147
本文介绍了如何在IIS上运行应用程序池无限时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp .net应用程序,我在应用程序启动时在Global.asax上创建了一个函数,并在每五分钟后运行一次。一旦第一次请求Web应用程序,应用程序池就会启动并执行无限时间的操作但是在几个小时之后应用程序池仍然在运行,但它没有更新数据或调用该函数和应用程序池看起来处于空闲状态,当我检查任务时经理这个应用程序池显示4228K并且其数字保持不变。



如何在无限时间内运行此功能。



I have an asp .net application, I created a function on Global.asax on app start and running it after every five minutes. Once first request to web app the app pool starts and perform the actions for infinite time but after some hours app pool is still running but it is not updating the data or calling the function and app pool looks in idle state, when i check the task manager this app pool is showing 4228K and its figures remain still.

How can i run this function for infinite time.

void Application_Start(object sender, EventArgs e)
  {
      // Code that runs on application startup
      timer.Interval = 60000 ; //300,000 miliseconds = 5 minutes  1000 is 1 Sec
      timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
      //timer.Start();
      timer.Enabled = true;

  }

  void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
  {
      obj.GetData();

      obj.InsertDataIntoTable();

      obj.UpdateDataOfRequiredTable();

  }





应用程序池设置是,

空闲时间在最小值:0

平均周期:300

关闭时间限制:300

开始时间限制:300



The application pool setting is,
Idle Time Out In Min: 0
Ping Period : 300
Shut Time Limit : 300
Start Time Limit : 300

推荐答案

你能解决僵局吗?



我会在文本文件中添加一个活动日志。

我会在例行程序中放几个检查点来查看附加内容。

日志看起来像



日期时间例程推出

日期时间检查点A

日期时间检查点B

日期时间检查点C

日期时间常规完成

...
Can you have a deadlock ?

I would add an activity log to a text file.
I would put a few check points in the routine to see what append.
The log would look like

Date Time Routine Launched
Date Time Check point A
Date Time Check point B
Date Time Check point C
Date Time Routine Finished
...


这篇关于如何在IIS上运行应用程序池无限时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆