aws-billing

Does AWS Lambda charge for the time spent initializing code?

試著忘記壹切 提交于 2020-01-24 08:44:48
问题 If my Lambda function written in Python takes 1.8 seconds to initialize (during a cold start) and 400 ms to execute, am I charged for the 400 ms execution time or the entire 2.2 seconds of initialization + execution time? From X-Ray, I see: From CloudWatch logs, I see: Duration: 404.42 ms Billed Duration: 500 ms Memory Size: 448 MB Max Memory Used: 113 MB What I understand from this is that I was billed for 500ms of execution time, so does that mean code initialization (e.g. importing stuff)

Does AWS Lambda charge for the time spent initializing code?

橙三吉。 提交于 2020-01-24 08:44:29
问题 If my Lambda function written in Python takes 1.8 seconds to initialize (during a cold start) and 400 ms to execute, am I charged for the 400 ms execution time or the entire 2.2 seconds of initialization + execution time? From X-Ray, I see: From CloudWatch logs, I see: Duration: 404.42 ms Billed Duration: 500 ms Memory Size: 448 MB Max Memory Used: 113 MB What I understand from this is that I was billed for 500ms of execution time, so does that mean code initialization (e.g. importing stuff)