[英].Net Web Application app startup workflow for IIS
Okay, so let's say I have a web application that absolutely has to perform some kind of startup and has to remain running indefinitely regardless of the communication it receives from the clients (as it's a push based system) 好吧,让我们说我有一个绝对必须执行某种启动的Web应用程序,并且无论从客户端收到的通信如何都必须保持无限运行(因为它是基于推送的系统)
Now for testing I have been hosting this as a windows service, which is great because it allows for me to have a hard entry point to the application where I can do my bootstrapping and get the service up and running 现在进行测试我一直把它作为一个Windows服务托管,这很棒,因为它允许我有一个硬入口点到应用程序,我可以进行自举,并启动和运行服务
Next, I'm trying to move this into the IIS world instead so I can face this service to the outside world...and I've hit a snag...I don't have any hard entry point where I can bootstrap the application except for global.asax, which as I understand it is only invoked when the clients make a call to the server 接下来,我试图将其转移到IIS世界中,以便我可以面向外界使用这项服务......而且我遇到了麻烦......我没有任何难以进入的地方我可以引导除了global.asax之外的应用程序,据我所知,它仅在客户端调用服务器时调用
Is there a better area I can put an entrance to the application and get it bootstrapped without waiting for a client to connect to it? 有没有更好的区域我可以放入应用程序的入口并让它自动引导而无需等待客户端连接到它? And is this area only called once or is it going to be called periodically as the application falls out of scope (so to speak)?
这个区域只被调用一次还是会被定期调用,因为应用程序超出了范围(可以这么说)? Like I said, the app has to remain running at all times
就像我说的那样,应用程序必须始终保持运行状态
Is there a better area I can put an entrance to the application and get it bootstrapped without waiting for a client to connect to it?
有没有更好的区域我可以放入应用程序的入口并让它自动引导而无需等待客户端连接到它?
Yes, there is. 就在这里。 You can warm up IIS .
你可以热身IIS 。
And is this area only called once or is it going to be called periodically as the application falls out of scope (so to speak)?
这个区域只被调用一次还是会被定期调用,因为应用程序超出了范围(可以这么说)?
It depends which method in Global.asax you use. 这取决于您使用Global.asax中的哪种方法。
Application_Start
runs once per app start. Application_Start
每个应用程序启动运行一次。
Like I said, the app has to remain running at all times
就像我说的那样,应用程序必须始终保持运行状态
Beware, dragons here. 小心,龙在这里。 This depends how critical it is.
这取决于它的重要程度。 If you need utter reliability, you must use load balancer and have at least one other duplicate service.
如果您需要完全可靠性,则必须使用负载平衡器并至少具有一个其他重复服务。 Other things to consider, app pool needs to be recycled from time to time.
其他需要考虑的事项,应用程序池需要不时回收。 IIS, OS, your application have bugs, updates needs to be installed, network device fails, power outages do happen and so on.
IIS,操作系统,您的应用程序有错误,需要安装更新,网络设备出现故障,停电确实发生等等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.