IIS应用程序池回收+石英调度 [英] IIS app pool recycle + quartz scheduling

查看:229
本文介绍了IIS应用程序池回收+石英调度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行在IIS 7.5 Web应用程序,它需要偶尔回收(否则内存使用情况失控移交的,什么我寻找到!)。

I'm running a web app on IIS 7.5 and it needs to recycle occasionally (otherwise memory usage gets out of handing, something i'm looking into!).

当它回收,它有效地不运行,直到另一个请求时,其中石英是不会运行的。

When it recycles, it is effectively not running until another request comes in, which quartz is not going to run.

有什么办法让IIS自动调出1的工作进程回收应用程序池,以确保石英永远在线后立即?

Is there any way to have IIS automatically bring up 1 work process immediately after recycling the app pool to ensure quartz is always online?

推荐答案

是的!

<一个href=\"http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx\" rel=\"nofollow\">http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx详情它很好地,基本上你需要:

http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx details it quite nicely, basically you need to:


  1. 编辑C:\\ WINDOWS \\ SYSTEM32 \\ INETSRV \\设置\\的applicationHost.config包括:

  1. Edit C:\Windows\System32\inetsrv\config\applicationHost.config to include:

<applicationPools> 
    <add name="MyAppWorkerProcess" managedRuntimeVersion="v4.0" startMode="AlwaysRunning" /> 
</applicationPools>


  • 声明一下应该运行的热身为您的网站

  • Declare what should be run as the "warm-up" for your site

    <sites> 
        <site name="MySite" id="1"> 
            <application path="/" serviceAutoStartEnabled="true" serviceAutoStartProvider="PreWarmMyCache" />
        </site> 
    </sites>
    <serviceAutoStartProviders> 
        <add name="PreWarmMyCache" type="PreWarmCache, MyAssembly" /> 
    </serviceAutoStartProviders> 
    


  • 配置与任何你想热身的逻辑应用程序:

  • Configure your application with whatever "warm-up" logic you would like:

    public class PreWarmCache : System.Web.Hosting.IProcessHostPreloadClient {
        public void Preload(string[] parameters) { 
            // Perform initialization and cache loading logic here... 
        } 
    } 
    


  • 请注意:如果你需要的是w3wp.exe进程是present我相信,只有第1步是必要的。如果还需要其他项目(如某些事情被加载到存储器中),则步骤2和3就也可以使用。

    Note: If all you need is for the w3wp.exe process to be present I believe only step 1 is necessary. If you also need other items (like certain things to be loaded into memory) then step 2 and 3 would also be used.

    这篇关于IIS应用程序池回收+石英调度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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