SNS 的 Lambda 节流行为
Lambda Throttling Behaviour with SNS
在阅读有关 Lambda 函数重试行为的 SNS FAQ 部分时,我遇到了以下语句:
Q: What happens to Amazon SNS messages if the subscribing endpoint is not available?
Lambda: If Lambda is not available, SNS will retry 2 times at 1 seconds apart, then 10 times exponentially backing off from 1 seconds to 20 minutes and finally 38 times every 20 minutes for a total 50 attempts over more than 13 hours before the message is discarded from SNS.
据我所知,Lambda 函数实现了自己的节流重试机制,如 Lambda Throttling Bevaviour Documentation:
中所述
Asynchronous invocation: If your Lambda function is invoked asynchronously and is throttled, AWS Lambda automatically retries the throttled event for up to six hours, with delays between retries.
那么,当功能受到限制并出现另一条 SNS 消息时,究竟会发生什么? SNS 是否将 Lambda 视为 "available" 并中止重试机制,允许 Lambda 自动重试,还是继续重试传递消息?
单词"available"指的是SNS联系Lambda服务并提交单个请求以调用函数的能力。
理解这一点的关键要求您首先了解 SNS invokes Lambda functions asynchnously,然后理解其含义。
异步调用请求不会向调用者(在本例中为 SNS)提供任何反馈,函数 运行 是立即执行还是被限制,或者它是成功还是抛出异常。
SNS >> Lambda: "Hi, run this Lambda function asynchronously, with this payload."
Lambda >> SNS: "Okay, I received your request and will do that as soon as it is possible. Goodbye."
来电者(SNS)不关心接下来的细节。成功发出请求后,SNS 完成处理该消息,现在由 Lambda 服务立即调用该函数 and/or 参与记录的 Lambda 重试行为。
SNS 每条消息实际上只联系 Lambda 服务一次。当它不能做到这一点时,Lambda 就不会 "available." 这应该发生得非常非常少......但是如果 SNS 无法建立联系,那就是当 SNS 参与 SNS 常见问题解答中描述的行为时——尝试提交调用函数的请求。一旦完成,SNS 的角色就完成了,其余的由 Lambda 服务处理。
每条消息都在 SNS/Lambda 集成中独立处理,SNS 会尽快处理每条消息,SNS 不会意识到函数调用随后是否受到限制。
在阅读有关 Lambda 函数重试行为的 SNS FAQ 部分时,我遇到了以下语句:
Q: What happens to Amazon SNS messages if the subscribing endpoint is not available? Lambda: If Lambda is not available, SNS will retry 2 times at 1 seconds apart, then 10 times exponentially backing off from 1 seconds to 20 minutes and finally 38 times every 20 minutes for a total 50 attempts over more than 13 hours before the message is discarded from SNS.
据我所知,Lambda 函数实现了自己的节流重试机制,如 Lambda Throttling Bevaviour Documentation:
中所述Asynchronous invocation: If your Lambda function is invoked asynchronously and is throttled, AWS Lambda automatically retries the throttled event for up to six hours, with delays between retries.
那么,当功能受到限制并出现另一条 SNS 消息时,究竟会发生什么? SNS 是否将 Lambda 视为 "available" 并中止重试机制,允许 Lambda 自动重试,还是继续重试传递消息?
单词"available"指的是SNS联系Lambda服务并提交单个请求以调用函数的能力。
理解这一点的关键要求您首先了解 SNS invokes Lambda functions asynchnously,然后理解其含义。
异步调用请求不会向调用者(在本例中为 SNS)提供任何反馈,函数 运行 是立即执行还是被限制,或者它是成功还是抛出异常。
SNS >> Lambda: "Hi, run this Lambda function asynchronously, with this payload."
Lambda >> SNS: "Okay, I received your request and will do that as soon as it is possible. Goodbye."
来电者(SNS)不关心接下来的细节。成功发出请求后,SNS 完成处理该消息,现在由 Lambda 服务立即调用该函数 and/or 参与记录的 Lambda 重试行为。
SNS 每条消息实际上只联系 Lambda 服务一次。当它不能做到这一点时,Lambda 就不会 "available." 这应该发生得非常非常少......但是如果 SNS 无法建立联系,那就是当 SNS 参与 SNS 常见问题解答中描述的行为时——尝试提交调用函数的请求。一旦完成,SNS 的角色就完成了,其余的由 Lambda 服务处理。
每条消息都在 SNS/Lambda 集成中独立处理,SNS 会尽快处理每条消息,SNS 不会意识到函数调用随后是否受到限制。