ApplicationPoolCpu.Limit Property

Definition

Gets or sets the maximum percentage of CPU time that the worker processes in an application pool are allowed to consume over a period of time.

public:
 property long Limit { long get(); void set(long value); };
public long Limit { get; set; }
member this.Limit : int64 with get, set
Public Property Limit As Long

Property Value

The maximum percentage of CPU time, in hundredths of one percent, that the worker processes in an application pool are allowed to consume over a period of time. The default is 0, which disables CPU limiting.

Examples

The following example checks the value of the Limit property. If the limit is set to more than 25 milliseconds, the value is reset to 25. This code example is part of a larger example provided for the ApplicationPoolCpu class.

// Set the ApplicationPoolCPU.Limit to a maximum of 2.5 milliseconds.
if (apppool.Cpu.Limit > 25)
{
    apppool.Cpu.Limit = 25;
    apppool_isdirty = true;
}

Remarks

The period of time to which the limit applies is specified by the ResetInterval property. If the limit set by the Limit property is exceeded, an event is written to the event log and an optional set of events is triggered as determined by the Action property.

You can see and modify the Limit property in the Advanced Settings dialog box in IIS Manager.

When you set the Limit property, you need to call the Microsoft.Web.Administration.ServerManager.CommitChanges method to persist the changes to the ApplicationHost.config file.

Note

Setting this property to the default value of 0 disables CPU limiting.

Applies to