AWS Lambda热启动和冷启动 [英] AWS Lambda Hot and Cold Start

查看:455
本文介绍了AWS Lambda热启动和冷启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是AWS Lambda的新手,我想知道Hot Lambda函数(Hot Start)和Cold Lambda函数(Cold Start)是什么意思?有人可以详细解释一下吗? Hot Lambda和Cold Lambda有什么区别

Hello I am new to AWS Lambda.I want to know what do we mean by Hot Lambda function (Hot Start) and Cold Lambda function (Cold Start) ?? Can anyone please explain me in detail & what is the difference between Hot Lambda and Cold Lambda

推荐答案

上传代码后或一段时间不活动后,您的Lambda已关闭或冷".当发生新事件时,Lambda会短暂地启动代码的新实例-这包括初始化AWS为启动容器"所做的所有工作以及初始化您上载的代码.

After uploading your code or after periods of inactivity your Lambda is shut down or "cold". When a new event comes in there is a brief moment where Lambda spins up a new instance of your code - this includes whatever initializing AWS does to start up the "container" as well as initializing the code that you uploaded.

因此,从理论上讲,能够击中已初始化(热")Lambda的事件将比击中冷事件更快.上一次事件发生后,Lambda不会保持多长时间无法保证,但可能长达5分钟.

So an event that is able to hit an initialized("hot") Lambda will in theory be processed faster than hitting a cold one. There isn't a guarantee on how long a Lambda will stay hot after the last event but it could be as long as 5 minutes.

这篇关于AWS Lambda热启动和冷启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆