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

design(aws-ecs) Design proposal for Queue Worker Service L3 construct #2402

Closed
wants to merge 1 commit into from

Conversation

piradeepk
Copy link
Contributor

@piradeepk piradeepk commented Apr 30, 2019

Fixes #2396


Pull Request Checklist

  • Testing
    • Unit test added (prefer not to modify an existing test, otherwise, it's probably a breaking change)
    • CLI change?: coordinate update of integration tests with team
    • cdk-init template change?: coordinated update of integration tests with team
  • Docs
    • jsdocs: All public APIs documented
    • README: README and/or documentation topic updated
    • Design: For significant features, design document added to design folder
  • Title and Description
    • Change type: title prefixed with fix, feat and module name in parens, which will appear in changelog
    • Title: use lower-case and doesn't end with a period
    • Breaking?: last paragraph: "BREAKING CHANGE: <describe what changed + link for details>"
    • Issues: Indicate issues fixed via: "Fixes #xxx" or "Closes #xxx"
  • Sensitive Modules (requires 2 PR approvers)
    • IAM Policy Document (in @aws-cdk/aws-iam)
    • EC2 Security Groups and ACLs (in @aws-cdk/aws-ec2)
    • Grant APIs (only if not based on official documentation with a reference)

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

@piradeepk piradeepk requested a review from a team as a code owner April 30, 2019 22:16
@piradeepk piradeepk changed the title Design proposal for Queue Worker Service (aws-ecs) Design proposal for Queue Worker Service L3 construct Apr 30, 2019
@piradeepk piradeepk changed the title (aws-ecs) Design proposal for Queue Worker Service L3 construct design(aws-ecs) Design proposal for Queue Worker Service L3 construct Apr 30, 2019
@piradeepk
Copy link
Contributor Author

Open question: The scaling factor for the ApproximateNumberOfMessagesVisible metric will vary based on how fast a message can be processed by the container. Does it make sense to set a default and make it on the higher end and provide the option to pass in a custom value as part of the props? Would requiring the property be better?

Example:
scalingSteps: [
{ upper: 100, change: -1 },
{ lower: 500, change: +1 },
{ lower: 700, change: +3 },
]

@clareliguori
Copy link
Member

@pkandasamy91 Other consideration is how latency-sensitive the application is, so 200 messages may not be a big deal and not need scaling if the application's SLA for processing messages is 5 minutes. I think it makes sense to set a default and allow a property.

Side note, is there a minimum scaling set? Is it equal to the desired count?

@nathanpeck
Copy link
Member

I actually would only decrease the number of workers only if the approximate number of messages visible is zero.

@clareliguori
Copy link
Member

@nathanpeck Can you suggest a default step scaling policy for what you're suggesting?

@piradeepk
Copy link
Contributor Author

@pkandasamy91 Other consideration is how latency-sensitive the application is, so 200 messages may not be a big deal and not need scaling if the application's SLA for processing messages is 5 minutes. I think it makes sense to set a default and allow a property.

Side note, is there a minimum scaling set? Is it equal to the desired count?

Yes, the minimum scaling capacity is set to the desired task count (default 1 if not provided)

@piradeepk
Copy link
Contributor Author

I've added a scalingSteps prop and provided a default that seems reasonable (spoke to @nathanpeck and confirmed that it's a good starting point). Doc has been updated to address all other feedback as well

Copy link
Contributor

@SoManyHs SoManyHs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interfaces generally seem fine -- I'm not super familiar with the SQS construct lib so will have a better feel for this when it's implemented but besides making CPU part of the common props no major changes; most comments more about writing style/clarity.

design/aws-ecs-autoscaling-queue-worker.md Outdated Show resolved Hide resolved
design/aws-ecs-autoscaling-queue-worker.md Outdated Show resolved Hide resolved
design/aws-ecs-autoscaling-queue-worker.md Show resolved Hide resolved
design/aws-ecs-autoscaling-queue-worker.md Outdated Show resolved Hide resolved
design/aws-ecs-autoscaling-queue-worker.md Show resolved Hide resolved
design/aws-ecs-autoscaling-queue-worker.md Show resolved Hide resolved
@piradeepk
Copy link
Contributor Author

Squashed commits

@BDQ
Copy link
Contributor

BDQ commented May 14, 2019

Would something like this not be better suited to a third party module? Why does it need to be cdk itself?

I'd be wary of accepting lots of different L3 patterns for services, when there's a perfectly valid method of packaging them as independent modules, seems like it could explode an already sizable code base.

@eladb
Copy link
Contributor

eladb commented May 14, 2019

I tend to agree with @BDQ that these shouldn't go into the aws-ecs module. These are still 1st party and should be shipped together with the CDK but I think we should put these L3s under a new module. This is something @clareliguori and I also discussed. How about we move all the L3 patterns into a new module called @aws-cdk/aws-ecs-plus (we were discussing that we can use the "plus" "branding" to indicate those are higher level modules.

@rix0rrr @fulghum what do you guys think?

Thoughts?

@SoManyHs
Copy link
Contributor

This should be encapsulated in #2568. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

L3 Construct for creating a ECS/Fargate Service that processes from SQS Queue
7 participants