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

Write concurrency is much higher than default during restoration #49

Open
beyondbill opened this issue Aug 15, 2017 · 2 comments
Open

Comments

@beyondbill
Copy link

beyondbill commented Aug 15, 2017

I use dynamo-restore-from-s3 without setting -c. So by default the write currency should be 200.
However the actual write currency is as high as 1000!
image

It drops down gradually only because requests got throttled.

The version of dynamo-backup-to-s3 is 0.6.1

@beyondbill
Copy link
Author

beyondbill commented Aug 15, 2017

I dig a little bit into the code base and find that request concurrency and # of capacity units seem to be treated as the same thing here.
https://github.com/markitx/dynamo-backup-to-s3/blob/master/lib/dynamo-restore.js#L303

However based on Dynamo docs they are different.

One write capacity unit represents one write per second for an item up to 1 KB in size. If you need to write an item that is larger than 1 KB, DynamoDB will need to consume additional write capacity units. The total number of write capacity units required depends on the item size.

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ProvisionedThroughput.html

What if some of individual items in my Dynamo are larger than 1KB? Then writing each of them would consume more than 1 write capacity unit, although it just counts for 1 request.

It could explain why my case consumed much more write capacity units than 200.

@beyondbill
Copy link
Author

Find something deeper in the code base.
https://github.com/markitx/dynamo-backup-to-s3/blob/master/lib/dynamo-restore.js#L172
It actually bundles 25 items together and then make 1 request using AWS API dynamo.batchWriteItem
https://github.com/markitx/dynamo-backup-to-s3/blob/master/lib/dynamo-restore.js#L299
This will well explain why request body size can easily exceed 1KB. On average one item in our DynamoDB should be easily over 1024/25 bytes

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

No branches or pull requests

1 participant