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

ScaleUp to the number of message left in queue if < maxSize / 10 #272

Open
vincentsarago opened this issue Jul 25, 2018 · 0 comments
Open

Comments

@vincentsarago
Copy link

I'd like to know if we could change the behavior of the scaleUp lambda function to integrate the number of message left in the queue as a variable.

Let's consider that I have a stack with a maxSize set to 500, if a queue has 3 messages the stack will scale up to 50 when I need only 3 watcher.

How to ?

modify

exports.handler = function(event,context){
const result = Math.round(Math.max(Math.min(parseInt(event.ResourceProperties.maxSize) / 10, 100), 1));
response.send(event, context, response.SUCCESS, { ScalingAdjustment: result });
to first get the number of message left in the queue, and then choose the min between nMessage, maxSize/10 and 100.

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

No branches or pull requests

2 participants