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

Scale down dynamo #27

Open
FractalJim opened this issue Jun 6, 2018 · 6 comments
Open

Scale down dynamo #27

FractalJim opened this issue Jun 6, 2018 · 6 comments

Comments

@FractalJim
Copy link

FractalJim commented Jun 6, 2018

Dynamo tables can also consume a lot of resource when not in use. Though you can use auto-scaling, you wont necessarily be scaling down to 1. So if hammertime reduced read and write capacity of tables to 1 outside business hours and set back to what it was (including autoscaling settings) when it restored this could save some money.

@ramesius
Copy link
Contributor

ramesius commented Jun 6, 2018

Hi, thanks for the suggestion. Should be easy to implement, using these APIs:

We would need to identify any indexes on a table and scale those down too.

Dealing with tables that have autoscaling enabled might a bit tricky, we would have to query other AWS resources to find those I think, this also goes for indexes that might have auto-scaling.

@ramesius
Copy link
Contributor

ramesius commented Jun 6, 2018

For auto-scaled tables, we would need to query this API:

Using a ServiceNamespace of 'dynamodb' should do the trick, but it looks like these resources do not support tagging for us to record previous values prior the hammertime run.

@FractalJim
Copy link
Author

Could you not tag the tables themselves?

@ramesius
Copy link
Contributor

ramesius commented Jun 6, 2018

Yeah we could definetly do that, good idea. 👍

@ramesius
Copy link
Contributor

ramesius commented Jun 6, 2018

For tables without autoscaling it should be fairly simple to record previous values:

  • hammertime:readunits
  • hammertime:writeunits
    This would be the same for indexes that have no autoscaling.

For autoscaling I think we would need to store upto 6 values:

  • hammertime:autoscale-minreadunits
  • hammertime:autoscale-maxreadunits
  • hammertime:autoscale-minwriteunits
  • hammertime:autoscale-maxwriteunits
  • hammertime:autoscale-readutilization
  • hammertime:autoscale-writeutilization

Looks like we would also have to query this API to get the scalable targets https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ApplicationAutoScaling.html#describeScalableTargets-property as well as this to update the Min and Max values https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ApplicationAutoScaling.html#registerScalableTarget-property

@ramesius
Copy link
Contributor

ramesius commented Jun 6, 2018

On second thought we might not have to store the read/write utilization values if we do not change them 🤔

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

3 participants