当 IIS 6.0 上的 ASP.NET Web 应用程序 (asmx ws) 闲置数小时左右时,会发生什么情况?
我有一个 asmx Web 服务,并将一堆系统数据加载到内部数据结构中。该系统数据用于检查请求的有效性。但是,当 3 小时(可能更短)内没有请求时,将再次进行初始化。为请求提供服务的对象具有
私有静态 bool _initOk
控制初始化的 变量。当应用程序空闲时,该变量设置为 false。是因为IIS停止执行并且包含代码的dll被卸载还是其他什么原因?如果请求按稳定间隔到达,则不会再次进行初始化。我能做些什么吗?
谢谢!
br:马蒂
I have an asmx web service and I load bunch of system data to internal data structures. This system data is used to check the validity of requests. However when there is no requests for say 3 hours (maybe less) the initializations are done again. The object that serves the requests has
private static bool _initOk
variable that controls the initialzation. When application is idle the variable is set to false. Is it because IIS stops the execution and dll containing the code is unloaded or something? If requests arrive on steady interval the initializations are not done again. Is there anything I can do about it?
Thanks!
br: Matti
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它是应用程序池(在IIS管理器下找到)的设置,当进程闲置一段时间时是否停止该进程,或者在满足某些条件时是否重新启动(回收)它。
每次重新启动该进程时,都会再次完成初始化。
It is a setting of the application pool (found under IIS Manager), whether to stop the process, when it is iddle for a period of time, or wether to restart (recycle) it when certain conditions are met.
On each restart of the process, your initialization will be done again.