Questions on AWS Cloudwatch log billedDuration for lambda functions

Hi all,

While I did a load test on one of my lambda function which load the records into dynamsdb table for 30 million records, and I tried to look into the cloudwatch log for the lambda I tested, and find the total billed duration using the log insight to query the logs and sum up the number in milliseconds, it turned out that the sum was 339460600 milliseconds billed duration. it is about 90 hours, but my lambda on ran about 4 hours. any comments on this? did I miss anything here? Thanks!

Lambda’s can’t actually run for 4 hours so I assume you mean the test took 4 hours. You don’t say anything about how many Lambda’s you invoked, how long each took to run or how many you ran concurrently. All of this is really important. For example: Your Lambda might take 20ms to execute but you’re still going to be billed for 100ms (5x the actual time).

Thanks for the replies. The lambda had been invoked over 250000 times in 4 hours. and billed the duration was over 300 million milliseconds(a few days). That’s what I was confused. Later I realized that the concurrent executions of the lambda, which made this happening. Resolved. Thanks!