Class MemoryUtilizationScalingProps
The properties for enabling scaling based on memory utilization.
Inheritance
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class MemoryUtilizationScalingProps : Object, IMemoryUtilizationScalingProps, IBaseTargetTrackingProps
Syntax (vb)
Public Class MemoryUtilizationScalingProps
Inherits Object
Implements IMemoryUtilizationScalingProps, IBaseTargetTrackingProps
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
var loadBalancedFargateService = new ApplicationLoadBalancedFargateService(this, "Service", new ApplicationLoadBalancedFargateServiceProps {
Cluster = cluster,
MemoryLimitMiB = 1024,
DesiredCount = 1,
Cpu = 512,
TaskImageOptions = new ApplicationLoadBalancedTaskImageOptions {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample")
}
});
var scalableTarget = loadBalancedFargateService.Service.AutoScaleTaskCount(new EnableScalingProps {
MinCapacity = 1,
MaxCapacity = 20
});
scalableTarget.ScaleOnCpuUtilization("CpuScaling", new CpuUtilizationScalingProps {
TargetUtilizationPercent = 50
});
scalableTarget.ScaleOnMemoryUtilization("MemoryScaling", new MemoryUtilizationScalingProps {
TargetUtilizationPercent = 50
});
Synopsis
Constructors
MemoryUtilizationScalingProps() |
Properties
DisableScaleIn | Indicates whether scale in by the target tracking policy is disabled. |
PolicyName | A name for the scaling policy. |
ScaleInCooldown | Period after a scale in activity completes before another scale in activity can start. |
ScaleOutCooldown | Period after a scale out activity completes before another scale out activity can start. |
TargetUtilizationPercent | The target value for memory utilization across all tasks in the service. |
Constructors
MemoryUtilizationScalingProps()
public MemoryUtilizationScalingProps()
Properties
DisableScaleIn
Indicates whether scale in by the target tracking policy is disabled.
public Nullable<bool> DisableScaleIn { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.
Default: false
PolicyName
A name for the scaling policy.
public string PolicyName { get; set; }
Property Value
System.String
Remarks
Default: - Automatically generated name.
ScaleInCooldown
Period after a scale in activity completes before another scale in activity can start.
public Duration ScaleInCooldown { get; set; }
Property Value
Remarks
Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency
ScaleOutCooldown
Period after a scale out activity completes before another scale out activity can start.
public Duration ScaleOutCooldown { get; set; }
Property Value
Remarks
Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency
TargetUtilizationPercent
The target value for memory utilization across all tasks in the service.
public double TargetUtilizationPercent { get; set; }
Property Value
System.Double