AWS Lambda冷启动时间计算

时间:2018-07-20 09:05:42

标签: amazon-web-services aws-lambda aws-serverless cold-start

我想了解AWS Lambda计费持续时间与冷启动之间的关系。根据下面的Cloudwatch日志,我的应用程序花费了大约6.8秒才能启动,并且计费持续时间约为4秒,后续请求的计费持续时间较短,因为容器将处于热状态。

运行时:Java8内存:512 MB

[2018-07-20 08:49:33.455] NO-REQUEST-ID INFO c.a.s.p.i.LambdaContainerHandler - Starting Lambda Container Handler 
[2018-07-20 08:49:33.666] NO-REQUEST-ID INFO c.a.s.p.i.s.AwsServletContext - 1 Spring WebApplicationInitializers detected on classpath 
.
.
.
2018-07-20 08:49:40.855 INFO 1 --- [ main] Application : Started Application in 6.873 seconds (JVM running for 8.156)
START RequestId: d2489678-8be9-11e8-8a6e-094e55395805 Version: $LATEST
2018-07-20 08:49:41.136 ERROR 1 --- [ main] c.a.s.p.i.s.AwsProxyHttpServletRequest : Called set character encoding to UTF-8 on a request without a content type. Character encoding will not be set
2018-07-20 08:49:44.674 INFO 1 --- [ main] c.a.s.p.internal.LambdaContainerHandler : 127.0.0.1 - [01/01/1970:00:00:00Z] "GET /employee null" 200 193 "-" "Custom User Agent String" combined
END RequestId: d2489678-8be9-11e8-8a6e-094e55395805
REPORT RequestId: d2489678-8be9-11e8-8a6e-094e55395805  Duration: 3859.12 ms    Billed Duration: 3900 ms Memory Size: 512 MB    Max Memory Used: 166 MB 

要计算冷启动时间,我需要考虑什么时间范围?根据上述记录,将冷启动时间测量为9秒(08:49:44-08:49:33)是否正确?

0 个答案:

没有答案