VPC澄清中的AWS Lambda ENI限制 [英] AWS Lambda ENI limitation in VPC clarification

查看:212
本文介绍了VPC澄清中的AWS Lambda ENI限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AWS官方文档中找到了 lambda >:

I found this in the AWS official docs for lambda:

如果Lambda函数访问VPC,则必须确保您的VPC具有足够的ENI容量以支持Lambda函数的扩展要求.您可以使用以下公式大致确定ENI要求.

If your Lambda function accesses a VPC, you must make sure that your VPC has sufficient ENI capacity to support the scale requirements of your Lambda function. You can use the following formula to approximately determine the ENI requirements.

预计的并发执行高峰*(以GB/3GB的内存为单位)

Projected peak concurrent executions * (Memory in GB / 3GB)

我了解此公式背后的原因.我唯一的问题是:为什么要3GB?这个数字是从哪里来的?

I understand the reason behind this formula. My only question is: why 3GB? From where this number comes from?

推荐答案

公式预计的峰值并发执行次数×(以GB/3GB表示的内存)是实际答案的代理(但不发声) )问题为了容纳所需数量的这种大小的容器,Lambda需要分配多少个m类(通用)EC2实例?"

The formula Projected peak concurrent executions × (Memory in GB / 3GB) is a proxy for the answer to the actual (but unspoken) question "How many m-class (general purpose) EC2 instances will Lambda need to allocate in order to accommodate the required number of containers of this size?"

AWS Lambda通过使用与通用Amazon EC2实例类型(例如M3类型)相同的比率来分配与内存成比例的CPU能力.

AWS Lambda allocates CPU power proportional to the memory by using the same ratio as a general purpose Amazon EC2 instance type, such as an M3 type.

https://docs.aws.amazon.com/lambda/latest/dg/resource-model.html

比率是相同的",因为M3或与之非常相似的东西是Lambda在引擎盖下实际用来存放容器的东西.

The ratio is "the same" because the M3... or something very similar to it... is what Lambda is actually using, under the hood, to host your containers.

m3.medium是m3系列中最小的计算机,具有3.75GB的RAM ...因此,lambda将需要提供的此类EC2 VM的数量-因此,必需-大约为 n×(m/3GB).该实例可以托管(例如)大约2×1.5 GB或24×128 MB或1×3.0 GB容器,从而为VM内的操作/管理开销留出一些空间.

The m3.medium is the smallest machine of the m3 family and has 3.75GB of RAM... so the number of this type of EC2 VM that lambda will need to provision -- and thus the number of ENIs that will be needed -- is approximately n × (m / 3GB). This instance could host (e.g.) approximately 2 × 1.5 GB or 24 × 128 MB or 1 × 3.0 GB containers, leaving some room for operational/management overhead within the VM.

可能涉及多少开销,Lambda在放置和选择容器时使用的算法,Lambda是否使用实例大小的混合以及在什么规则下……都是Lambda黑盒的一部分.逻辑将指示Lambda将以较小的实例开始,并随着并发性的增长而逐步发展为较大的实例,因为较大的实例(在同一系列中)将允许更高的打包效率而不会降低性能(因为内存和CPU是专用的,且固定比例) ,到每个容器),特别是对于大型和奇特尺寸的容器.该公式表明,不是容器接收ENI,而是实例 ...,并且会有大约 n×(m/3GB )由Lambda在大小为 m GB的并发 n 下分配的实例.

How much overhead may be involved, and the algorithm Lambda uses when placing and selecting containers, and whether Lambda uses a mix of instance sizes and under what rules... are all part of the Lambda black box. Logic would dictate that Lambda would start with smaller instances and progress to larger ones as concurrency grows, since the larger instances (within the same family) would allow more packing efficiency without a performance penalty (since memory and CPU are dedicated, in a fixed ratio, to each container), particularly for large and oddly-sized containers. What this formula reveals that it is not containers that receive ENIs but rather instances... and there will be approximately n × (m / 3GB) instances allocated by Lambda under concurrency n of size m GB.

这篇关于VPC澄清中的AWS Lambda ENI限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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