ASP.NET应用程序池关闭问题
有时,异常会导致应用程序池
关闭。我手动启动它,但问题是如何在 IIS 7.0 (Windows server 2008) 中自动执行此行为。
Sometimes an exception causes application pool
to shutdown. I start it manually but the question is how can I automate this behavior in IIS 7.0
(Windows server 2008).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果应用程序池终止,则对该池提供的资源的下一个请求将自动重新启动它。但是,如果您在应用程序池上启用了快速失败保护,并且在失败间隔指定的时间间隔内,该池死亡的次数超过了最大失败属性指定的次数em> 属性,那么您将收到 503 Service Unavailable 消息。此时,您必须手动重新启动应用程序池。
要解决此问题,请禁用应用程序池的快速故障保护,或尝试增加该时间段内的故障数量,然后确定终止应用程序池的异常的根本原因。
If an application pool dies, the next request for a resource served by that pool will automatically restart it. If, however, you have rapid fail protection enabled on the app pool, and the pool dies more times than the number specified by the maximum failures property within the interval specified by the failure interval property, then you will receive a 503 Service Unavailable message. At this point, you will have to manually restart the app pool.
To work around this, either disable rapid fail protection for the app pool, or try increasing the number of faults within the time period, and then determine the root cause of the exceptions which are terminating the app pool.
打开iis,选择您的网站,在右侧您会看到
浏览网站下的操作 ->高级设置
选择自动启动为真。
open iis select your website and on right hand side u see Actions
under Browse Web site -> Advanced Setting
select start Automatically to true.
我在 Windows Server 2012 Standard 和 IIS 8 中遇到了类似的问题。末尾带有 & 符号的 URL 会导致 IIS 崩溃,并认为它们是恶意的。这会导致应用程序池失败,从而导致网站崩溃。
您需要做的是观看事件查看器中的 1309 事件。 (在事件 ID 列中)您可以使用任务计划程序进行设置。当您看到该事件时,您可以重新启动应用程序池。
要重新启动应用程序池,您可以使用如下所示的 .vbs 脚本:
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
设置 oAppPool = oWebAdmin.Get("ApplicationPool.Name='DefaultAppPool'")
' 回收应用程序池。
oAppPool.Recycle
或者,如果您更喜欢,也可以使用 Powershell。
我使用在这里找到的一个非常简洁的 C# 程序:
http://www.west-wind.com/weblog/posts/2012/Oct/02/A-tiny-Utility-to-recycle-an-IIS-Application-Pool
它做得很好,并且似乎解决了前两种方法存在的一些权限问题。不过,我确实必须以管理员身份运行此脚本。
希望这有帮助。它不能解决问题,但可以缓解热度,直到找到解决此 URL 问题的方法。
I am having a similar problem in Windows Server 2012 Standard and IIS 8. URLs with an ampersand character at the end cause IIS to freak out, and consider them malicious. This causes the App Pool to fail, crashing the website.
What you need to do is watch the Event Viewer for 1309 events. (In the Event ID column) You can set this up using Task Scheduler. When you see the event, you restart the App Pool.
To restart the App Pool, you can use a .vbs script like this:
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
Set oAppPool = oWebAdmin.Get("ApplicationPool.Name='DefaultAppPool'")
' Recycle the application pool.
oAppPool.Recycle
Or you could use Powershell if you like that better.
I use a pretty neat C# program that I found here:
http://www.west-wind.com/weblog/posts/2012/Oct/02/A-tiny-Utility-to-recycle-an-IIS-Application-Pool
It does a great job, and seems to get around some of the permissions issues that the previous two methods have. I do have to run this script as an admin, though.
Hope this helps. It does not solve the problem, but it will take the heat off until there is a solution to this URL issue.