channl / dynamodb-lambda-autoscale

Autoscale DynamoDB provisioned capacity using Lambda
MIT License
313 stars 88 forks source link

Add throttle metrics to describeTableConsumedCapacityAsync #29

Closed tylfin closed 7 years ago

tylfin commented 8 years ago

From Amazon: "It is possible to have short spikes in consumed [READ/WRITE] capacity which do not show up [because] it is an average. So be careful when adjusting table [READ/WRITE] capacity to pay attention to the Throttled [READ/WRITE] Requests..."

Had a use-case for this type of functionality in my production system. Figured it would be useful for others and wanted to give back. Thanks for the awesome package!

tmitchel2 commented 8 years ago

Hey thanks this looks like a great addition! Im working hard on another project at the moment but once i get some free time ill look to merge it.

breath103 commented 8 years ago

👍 love to see this get merged

estahn commented 7 years ago

Any update on this?

tmitchel2 commented 7 years ago

Sorry about the wait, merged now. I did find a few flow type errors and a bug where writes were getting applied to reads. @tylfin could you review my changes.

tylfin commented 7 years ago

Looks great, thanks @tmitchel2

schodemeiss commented 7 years ago

So, now this is in, is there anything I need to add to my provisioner to use it?

tylfin commented 7 years ago

@schodemeiss This PR just makes the throttledReads/Writes available. You need to determine in your config when to scale (best place is here https://github.com/channl/dynamodb-lambda-autoscale/blob/master/src/Provisioner.js#L34).

When you're running into massive throttles and need to scale, it usually means you have a hot-key issue. These issues tend to get worse over time if you're not pruning, so ensure you have the correct DynamoDB schema architecture before throwing money at the problem.