ApplicationPoolDefaults.Cpu Property

Definition

Gets CPU usage parameters for the application pool.

public:
 property Microsoft::Web::Administration::ApplicationPoolCpu ^ Cpu { Microsoft::Web::Administration::ApplicationPoolCpu ^ get(); };
public Microsoft.Web.Administration.ApplicationPoolCpu Cpu { get; }
member this.Cpu : Microsoft.Web.Administration.ApplicationPoolCpu
Public ReadOnly Property Cpu As ApplicationPoolCpu

Property Value

An ApplicationPoolCpu object that contains default CPU usage parameters.

Examples

The following example sets and displays the value of the Limit property and displays the value of the Action property. This code example is part of a larger example provided for the ApplicationPoolDefaults class.

Console.WriteLine("Cpu.Limit:\t{0}",
    manager.ApplicationPoolDefaults.Cpu.Limit.ToString());
Console.WriteLine("   Action:\t{0}",
    manager.ApplicationPoolDefaults.Cpu.Action.ToString());
manager.ApplicationPoolDefaults.AutoStart = false;
manager.ApplicationPoolDefaults.Cpu.Limit = 26;
manager.ApplicationPoolDefaults.Recycling.PeriodicRestart.Time = TimeSpan.FromMinutes(1000);
// Create a new application pool.
ApplicationPoolCollection applicationPoolCollection = manager.ApplicationPools;
applicationPoolCollection.Add("new app pool");
// Commit the changes to ApplicationHost.config file.
manager.CommitChanges();

Remarks

You can use the properties and methods of the object returned by the Cpu property to configure CPU usage parameters for a new application pool.

Applies to

See also