确定应用程序池上次回收的时间
我正在编写一个监视应用程序池的.NET 服务。根据特定的触发器我正在重新启动它们。 但是,如果触发器发生在它们最后一次回收之前,我不想重新启动它们。如何知道应用程序池的“最后回收时间”?
I'm writing a .NET service that monitors application pools. based on specific triggers I'm restarting them.
However, I do not want to restart them if the trigger occurred before they were recycled for the last time. How can I know the "last recycle time" of an app pool?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果
LogEventOnRecycle
< /a> 属性设置后,您应该能够使用EventLog 类
If the
LogEventOnRecycle
property is set, you should be able to read this information from the event log using theEventLog Class
我深入查看了事件日志,并且能够检测到应用程序池上次回收的时间,但它非常占用 CPU 资源,因为您必须从磁盘读取日志。我强烈建议使用
I went down the rabbit hole of looking through the event log and I was able to detect last when an app pool was last recycled but it was very cpu intensive because you have to read logs from the disk. I would highly suggest using