10

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).

3 Answers 3

17
+100

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.

Rapid Fail Settings

Sign up to request clarification or add additional context in comments.

3 Comments

It doesn't restart on next request. Can you provide a link ?
@xaqron - Sure, here's a link to the IIS app pool defaults. Of particular interest is the startMode property. The default value is onDemand which starts the app pool on the first HTTP request received. Have you tried disabling Rapid-Fail Protection? Try that, then ensure that your app pool is started. Does it still die? What IIS-related errors are in your Application and System event logs?
@xaqron - The startMode property was added to the IIS 7.5 configuration, however if you are running IIS 7, the default behavior for the app pool emulates startMode = onDemand, that should be stated in that document I previously linked.
2

alt textopen iis select your website and on right hand side u see Actions

under Browse Web site -> Advanced Setting

select start Automatically to true.

1 Comment

That's already true and it's about starting website on IIS start. I need something to monitor application pools and start them on failure.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.