2 réponses
- Le plus récent
- Le plus de votes
- La plupart des commentaires
1
Concurrency is achieved by 2 factors:
- The number of partitions in your DynamoDB table
- The parallelization factor of your Lambda function
I'm guessing your DynamoDB table has a single partition, which results in a single shard in the stream, and thus a single Lambda invocation. To increase concurrency you can do the following:
- Increase your WCU on your DynamoDB table to 40,000 WCU and when the table is
active
, reduce it to your working capacity needs. This will increase the partitions and ultimately increase the parallelization. - Increase the Parallelization Factor to a value up to a max of 10. That is for every shard in the stream you can have 10X Lambdas invoked.
0
You can use the AWS SDK for Node.js or Python to handle the stream events and invoke other Lambda functions asynchronously. And have you check to make sure your function is not meeting any memory or time limits. And I'm sure that you're already using the step function.
répondu il y a un an
What, this makes absolutely no sense?
Contenus pertinents
- demandé il y a un an
- demandé il y a un an
- demandé il y a 6 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a un an
Thank you much, Leeroy - I think you are right that my assumption about having multiple partitions (due to sparse partition key) was incorrect. I tried setting the Parallelization Factor to 10 and saw concurrency happening (which I could have sworn I tried before and it didn't work). I wish there was an easy way to know in real time how many partitions my table has, especially since we are using on-demand capacity. Thanks again for your answer!
You can understand how many partitions you have by reading your DynamoDB Stream shards. List the shards in your stream, loop over them and count the ones which are marked as
Active
, this will be the number of partitions you have in your table.