ApplicationPoolFailure.RapidFailProtection Property

Definition

Gets or sets a value indicating whether rapid-fail protection is on or off.

public:
 property bool RapidFailProtection { bool get(); void set(bool value); };
public bool RapidFailProtection { get; set; }
member this.RapidFailProtection : bool with get, set
Public Property RapidFailProtection As Boolean

Property Value

true if rapid-fail protection is on; false if rapid-fail protection is off. The default is true.

Examples

The following example displays the value of the RapidFailProtection property. If the property value is true, this example sets the RapidFailProtectionInterval and RapidFailProtectionMaxCrashes property values. This code example is part of a larger example provided for the ApplicationPoolFailure class.

Console.WriteLine("RapidFailProtection:\t{0}",
    manager.ApplicationPoolDefaults.Failure.RapidFailProtection);
// If the RapidFailProtection is enabled, set 
// the Interval and maximum crashes properties.
if (manager.ApplicationPoolDefaults.Failure.RapidFailProtection)
{
    manager.ApplicationPoolDefaults.Failure.
        RapidFailProtectionInterval = (TimeSpan.FromMinutes(10));
    manager.ApplicationPoolDefaults.Failure.
        RapidFailProtectionMaxCrashes = 6;
}
// Commit the changes to ApplicationHost.config file.
manager.CommitChanges();

Remarks

true indicates that the applications in an application pool are put out of service when the number of worker process crashes reaches the maximum specified by the RapidFailProtectionMaxCrashes property within the time specified by the RapidFailProtectionInterval property. The default is true.

When an application pool detects that too many of its worker processes have become unhealthy in a specified period of time, rapid-fail protection is initiated. The communication channel for IIS is dropped. IIS detects the loss of communication, sends an error or warning to the event log, and then restarts the worker process. The application pool is taken out of service, and the kernel-mode driver returns an out-of-service message (503: Service Unavailable) to requests to that application pool.

Applies to