Class FairshareSchedulingPolicy
Represents a Fairshare Scheduling Policy. Instructs the scheduler to allocate ComputeEnvironment vCPUs based on Job shareIdentifiers.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class FairshareSchedulingPolicy : Resource, IFairshareSchedulingPolicy, ISchedulingPolicy, IResource, ISchedulingPolicyRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class FairshareSchedulingPolicy Inherits Resource Implements IFairshareSchedulingPolicy, ISchedulingPolicy, IResource, ISchedulingPolicyRef, IConstruct, IDependable, IEnvironmentAware
Remarks
The Faireshare Scheduling Policy ensures that each share gets a certain amount of vCPUs. The scheduler does this by deciding how many Jobs of each share to schedule relative to how many jobs of each share are currently being executed by the ComputeEnvironment. The weight factors associated with each share determine the ratio of vCPUs allocated; see the readme for a more in-depth discussion of fairshare policies.
Resource: AWS::Batch::SchedulingPolicy
ExampleMetadata: infused
Examples
var fairsharePolicy = new FairshareSchedulingPolicy(this, "myFairsharePolicy");
fairsharePolicy.AddShare(new Share {
ShareIdentifier = "A",
WeightFactor = 1
});
fairsharePolicy.AddShare(new Share {
ShareIdentifier = "B",
WeightFactor = 1
});
new JobQueue(this, "JobQueue", new JobQueueProps {
SchedulingPolicy = fairsharePolicy
});
Synopsis
Constructors
| FairshareSchedulingPolicy(Construct, string, IFairshareSchedulingPolicyProps?) | Represents a Fairshare Scheduling Policy. Instructs the scheduler to allocate ComputeEnvironment vCPUs based on Job shareIdentifiers. |
Properties
| ComputeReservation | Used to calculate the percentage of the maximum available vCPU to reserve for share identifiers not present in the Queue. |
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
| SchedulingPolicyArn | The arn of this scheduling policy. |
| SchedulingPolicyName | The name of this scheduling policy. |
| SchedulingPolicyRef | A reference to a SchedulingPolicy resource. |
| ShareDecay | The amount of time to use to measure the usage of each job. |
| Shares | The shares that this Scheduling Policy applies to. |
Methods
| AddShare(IShare) | Add a share this to this Fairshare SchedulingPolicy. |
| FromFairshareSchedulingPolicyArn(Construct, string, string) | Reference an existing Scheduling Policy by its ARN. |
Constructors
FairshareSchedulingPolicy(Construct, string, IFairshareSchedulingPolicyProps?)
Represents a Fairshare Scheduling Policy. Instructs the scheduler to allocate ComputeEnvironment vCPUs based on Job shareIdentifiers.
public FairshareSchedulingPolicy(Construct scope, string id, IFairshareSchedulingPolicyProps? props = null)
Parameters
- scope Construct
- id string
- props IFairshareSchedulingPolicyProps
Remarks
The Faireshare Scheduling Policy ensures that each share gets a certain amount of vCPUs. The scheduler does this by deciding how many Jobs of each share to schedule relative to how many jobs of each share are currently being executed by the ComputeEnvironment. The weight factors associated with each share determine the ratio of vCPUs allocated; see the readme for a more in-depth discussion of fairshare policies.
Resource: AWS::Batch::SchedulingPolicy
ExampleMetadata: infused
Examples
var fairsharePolicy = new FairshareSchedulingPolicy(this, "myFairsharePolicy");
fairsharePolicy.AddShare(new Share {
ShareIdentifier = "A",
WeightFactor = 1
});
fairsharePolicy.AddShare(new Share {
ShareIdentifier = "B",
WeightFactor = 1
});
new JobQueue(this, "JobQueue", new JobQueueProps {
SchedulingPolicy = fairsharePolicy
});
Properties
ComputeReservation
Used to calculate the percentage of the maximum available vCPU to reserve for share identifiers not present in the Queue.
public virtual double? ComputeReservation { get; }
Property Value
Remarks
The percentage reserved is defined by the Scheduler as:
(computeReservation/100)^ActiveFairShares where ActiveFairShares is the number of active fair share identifiers.
For example, a computeReservation value of 50 indicates that AWS Batch reserves 50% of the maximum available vCPU if there's only one fair share identifier. It reserves 25% if there are two fair share identifiers. It reserves 12.5% if there are three fair share identifiers.
A computeReservation value of 25 indicates that AWS Batch should reserve 25% of the maximum available vCPU if there's only one fair share identifier, 6.25% if there are two fair share identifiers, and 1.56% if there are three fair share identifiers.
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
The Faireshare Scheduling Policy ensures that each share gets a certain amount of vCPUs. The scheduler does this by deciding how many Jobs of each share to schedule relative to how many jobs of each share are currently being executed by the ComputeEnvironment. The weight factors associated with each share determine the ratio of vCPUs allocated; see the readme for a more in-depth discussion of fairshare policies.
Resource: AWS::Batch::SchedulingPolicy
ExampleMetadata: infused
SchedulingPolicyArn
The arn of this scheduling policy.
public virtual string SchedulingPolicyArn { get; }
Property Value
Remarks
The Faireshare Scheduling Policy ensures that each share gets a certain amount of vCPUs. The scheduler does this by deciding how many Jobs of each share to schedule relative to how many jobs of each share are currently being executed by the ComputeEnvironment. The weight factors associated with each share determine the ratio of vCPUs allocated; see the readme for a more in-depth discussion of fairshare policies.
Resource: AWS::Batch::SchedulingPolicy
ExampleMetadata: infused
SchedulingPolicyName
The name of this scheduling policy.
public virtual string SchedulingPolicyName { get; }
Property Value
Remarks
The Faireshare Scheduling Policy ensures that each share gets a certain amount of vCPUs. The scheduler does this by deciding how many Jobs of each share to schedule relative to how many jobs of each share are currently being executed by the ComputeEnvironment. The weight factors associated with each share determine the ratio of vCPUs allocated; see the readme for a more in-depth discussion of fairshare policies.
Resource: AWS::Batch::SchedulingPolicy
ExampleMetadata: infused
SchedulingPolicyRef
A reference to a SchedulingPolicy resource.
public virtual ISchedulingPolicyReference SchedulingPolicyRef { get; }
Property Value
Remarks
The Faireshare Scheduling Policy ensures that each share gets a certain amount of vCPUs. The scheduler does this by deciding how many Jobs of each share to schedule relative to how many jobs of each share are currently being executed by the ComputeEnvironment. The weight factors associated with each share determine the ratio of vCPUs allocated; see the readme for a more in-depth discussion of fairshare policies.
Resource: AWS::Batch::SchedulingPolicy
ExampleMetadata: infused
ShareDecay
The amount of time to use to measure the usage of each job.
public virtual Duration? ShareDecay { get; }
Property Value
Remarks
The usage is used to calculate a fair share percentage for each fair share identifier currently in the Queue. A value of zero (0) indicates that only current usage is measured. The decay is linear and gives preference to newer jobs.
The maximum supported value is 604800 seconds (1 week).
Shares
The shares that this Scheduling Policy applies to.
public virtual IShare[] Shares { get; }
Property Value
IShare[]
Remarks
Note: It is possible to submit Jobs to the queue with Share Identifiers that are not recognized by the Scheduling Policy.
Methods
AddShare(IShare)
Add a share this to this Fairshare SchedulingPolicy.
public virtual void AddShare(IShare share)
Parameters
- share IShare
Remarks
The Faireshare Scheduling Policy ensures that each share gets a certain amount of vCPUs. The scheduler does this by deciding how many Jobs of each share to schedule relative to how many jobs of each share are currently being executed by the ComputeEnvironment. The weight factors associated with each share determine the ratio of vCPUs allocated; see the readme for a more in-depth discussion of fairshare policies.
Resource: AWS::Batch::SchedulingPolicy
ExampleMetadata: infused
FromFairshareSchedulingPolicyArn(Construct, string, string)
Reference an existing Scheduling Policy by its ARN.
public static IFairshareSchedulingPolicy FromFairshareSchedulingPolicyArn(Construct scope, string id, string fairshareSchedulingPolicyArn)
Parameters
Returns
Remarks
The Faireshare Scheduling Policy ensures that each share gets a certain amount of vCPUs. The scheduler does this by deciding how many Jobs of each share to schedule relative to how many jobs of each share are currently being executed by the ComputeEnvironment. The weight factors associated with each share determine the ratio of vCPUs allocated; see the readme for a more in-depth discussion of fairshare policies.
Resource: AWS::Batch::SchedulingPolicy
ExampleMetadata: infused