简体   繁体   English

您可以将IIS7配置为在启动/回收应用程序池时自动启动Windows进程激活服务(WAS)应用程序吗?

[英]Can you configure IIS7 to autostart a Windows Process Activation Service (WAS) application when the application pool starts/recycles?

IIS 7.5 introduces the notion of auto-start providers, that allow you to get WAS to auto-load an application or assemblies when an application pool starts up. IIS 7.5引入了自动启动提供程序的概念,使您可以让WAS在应用程序池启动时自动加载应用程序或程序集。

Can a similar thing be achieved with IIS7? IIS7是否可以实现类似的目的?

Basically, we have an application that runs under WAS, and has an in-memory cache of data. 基本上,我们有一个在WAS下运行的应用程序,并且具有内存中的数据缓存。 When an application pool recycle occurs, my WAS deployed app won't actually be activated until the first hit for it is received. 当应用程序池回收发生时,直到收到第一个匹配项,我的WAS部署的应用程序才真正被激活。 This means that the cache is cold when the first hit is received. 这意味着在收到第一个命中时,高速缓存很冷。 It would be good to be able to pre-start the application as soon as the app pool is recycled. 能够在应用程序池回收后立即启动应用程序将是很好的。

Other options we've considered are: 我们考虑的其他选项是:

  • Deploying the application as a Windows service so it doesn't re-cycle (this would work, but the application lifecycle management of IIS/WAS is a useful thing apart from this issue) 将应用程序部署为Windows服务,这样它就不会循环使用(这可以工作,但是除了此问题之外,IIS / WAS的应用程序生命周期管理是一件有用的事情)

  • Writing a separate service whose job is to ping our application to warm it up. 编写一个单独的服务,其工作是对我们的应用程序执行ping操作以对其进行预热。

However, the nicest way would be to get IIS7/WAS to do this for us. 但是,最好的方法是让IIS7 / WAS为我们完成此任务。

In Windows 2008 you can log events that occur on the application pool, so you can log recycle events. 在Windows 2008中,您可以记录在应用程序池上发生的事件,因此可以记录回收事件。 You can configure the event viewer to start a program when a specified message has been logged. 您可以将事件查看器配置为在记录了指定消息后启动程序。 You could call your service or load the assemblies in that program. 您可以调用服务或将程序集加载到该程序中。

Would this be a feasible solution for you? 这对您来说是可行的解决方案吗?

Regards, 问候,

Michel 米歇尔

in the advanced settings of your application pool set your application pool to generate Recycle event log entry every time it is recycled; 在应用程序池的高级设置中,将应用程序池设置为在每次回收时生成回收事件日志条目; I think the option is "Specific Time". 我认为选项是“特定时间”。 Then you can use Windows Task Scheduler, create a script or something you want it to run that will hit your site so it can initialize. 然后,您可以使用Windows Task Scheduler,创建脚本或您希望其运行的脚本访问您的站点,以便对其进行初始化。 Set the trigger for the task to an even, set the Event Filter that you want to trigger the task and voila. 将任务的触发器设置为偶数,设置要触发任务的事件过滤器,瞧。

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

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