Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-rds : Allow full support for scaling configuration options #27183

Closed
2 tasks
npvisual opened this issue Sep 18, 2023 · 4 comments · Fixed by #28534
Closed
2 tasks

aws-rds : Allow full support for scaling configuration options #27183

npvisual opened this issue Sep 18, 2023 · 4 comments · Fixed by #28534
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@npvisual
Copy link

npvisual commented Sep 18, 2023

Describe the feature

Currently there are only 3 supported properties for ServerlessScalingOptions :

  • auto_pause
  • max_capacity
  • min_capacity

However the CloudFormation template allows for 2 more options :

Those allow for the configuration of the following behavior for an Aurora Serverless Cluster :

Force scaling the capacity to the specified values when the timeout is reached

This is an important configuration to control the impact that an auto-scaling event has on client applications.

Use Case

If a client application performs some long running queries / transactions against the Aurora Serverless Cluster then the server will never be able to auto-scale up / down as it will never find a scaling point. Also as pointed out in the Best practices for working with Amazon Aurora Serverless v1 doc, rolling back the auto-scaling transaction can take significant time.

So we should be able to provide the option to configure the Aurora Servless Cluster to forcefully up/down scale and let the application deal with that, if so desired.

Proposed Solution

Support the existing additional parameters that are currently available in the CloudFormation template for the AWS::RDS::DBCluster ScalingConfiguration property.

This could also follow a similar behavior that is used currently for the auto_pause option : if the duration value is 0 then forceful auto-scaling is enabled, if not then it's the duration of the timeout before the rollback.

Other Information

AuroraPostgresEngineVersion VER_13_9

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.95.1 (build ae455d8)

Environment details (OS name and version, etc.)

macOS 13.5.2 ; Debian 3.11.4-slim-bookworm

@npvisual npvisual added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 18, 2023
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Sep 18, 2023
@peterwoodworth
Copy link
Contributor

Thanks for the request, you're right that these are not currently supported, and I think your proposed solution sounds fine. Thanks for the research on this!

Source code

private renderScalingConfiguration(options: ServerlessScalingOptions): CfnDBCluster.ScalingConfigurationProperty {

@peterwoodworth peterwoodworth added good first issue Related to contributions. See CONTRIBUTING.md p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Sep 18, 2023
@edxlang
Copy link

edxlang commented Sep 19, 2023

Hi, I'd like to work on this.

@peterwoodworth
Copy link
Contributor

go for it @0xedl 🙂

@mergify mergify bot closed this as completed in #28534 Jan 3, 2024
mergify bot pushed a commit that referenced this issue Jan 3, 2024
…ter (#28534)

This pull request introduces two new properties to the `ServerlessCluster` class in the AWS CDK RDS package: `secondsBeforeTimeout` and `timeoutAction`. 

The `secondsBeforeTimeout` property allows users to specify the amount of time that Aurora Serverless v1 will attempt to find a scaling point to perform seamless scaling before enforcing the timeout action. The default value is 300 seconds (5 minutes).

The `timeoutAction` property allows users to specify the action to take when the timeout is reached. Users can choose between `ForceApplyCapacityChange`, which will force the capacity to the specified value as soon as possible, even without a scaling point, and `RollbackCapacityChange`, which will ignore the capacity change if a scaling point is not found. The default behavior is `RollbackCapacityChange`.

These enhancements provide users with more control over the scaling behavior of their Aurora Serverless clusters.

Closes #27183

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

github-actions bot commented Jan 3, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

paulhcsun pushed a commit to paulhcsun/aws-cdk that referenced this issue Jan 5, 2024
…ter (aws#28534)

This pull request introduces two new properties to the `ServerlessCluster` class in the AWS CDK RDS package: `secondsBeforeTimeout` and `timeoutAction`. 

The `secondsBeforeTimeout` property allows users to specify the amount of time that Aurora Serverless v1 will attempt to find a scaling point to perform seamless scaling before enforcing the timeout action. The default value is 300 seconds (5 minutes).

The `timeoutAction` property allows users to specify the action to take when the timeout is reached. Users can choose between `ForceApplyCapacityChange`, which will force the capacity to the specified value as soon as possible, even without a scaling point, and `RollbackCapacityChange`, which will ignore the capacity change if a scaling point is not found. The default behavior is `RollbackCapacityChange`.

These enhancements provide users with more control over the scaling behavior of their Aurora Serverless clusters.

Closes aws#27183

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2
Projects
None yet
3 participants