Does lambda memory allocation impact network bandwidth?

0

Even though the CPU and Memory is < 30% utilization at 1024mb, it appears that changing the lambda to 2048mb doubles the network throughput. My runtime is single threaded node.js so it shouldn't particularly be impacted by the additional vCPU. I can't find specific details about network scaling, it's just vaguely hinted at:

https://docs.aws.amazon.com/lambda/latest/operatorguide/computing-power.html

Adding more memory proportionally increases the amount of CPU, increasing the overall computational power available. If a function is CPU-, network- or memory-bound, then changing the memory setting can dramatically improve its performance.

Is there something more concrete to refer to?

已提问 2 年前2067 查看次数
3 回答
3
已接受的回答

Yes, the network performance will increase with memory. There are no specifics as there is no definitive performance since Lambda compute is abstracted from you and it is also protocol and application specific. You should benchmark your function with various memory sized to determine where you meet your requirements.

profile pictureAWS
已回答 2 年前
profile pictureAWS
专家
已审核 2 年前
profile pictureAWS
专家
已审核 2 年前
  • What's surprising to me is that at 1GB memory I'm seeing 1mb/s, at 2GB I see 2mb/s, but after that it makes no meaningful difference switching it to 10GB. This seems really low, and there's no indication on what ranges AWS lambda operates in so I can't tell if this is within expected levels or not. Same code on my own machine hitting the same target gets 7mb/s down.

0

If your lambda is interacting with resources inside your VPC or with AWS services, you should VPC enable your lambda function if you haven't done so already - https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html

Also make use of interface VPC endpoints for AWS services. That way the traffic goes over the AWS network and not the internet - https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html

profile pictureAWS
专家
已回答 2 年前
  • That's not an answer to anything I wrote, I was asking about network resources being affected by memory configuration like vCPU, nothing relating to VPC configuration.

0

All Lambda functions get the same type of network interface with the same bandwidth. However, the more memory you give your function, the more CPU it gets, which allows it to actually drive the network bandwidth, up to the limit that the network interface supports. This is why you will see an increase in bandwidth only until some point.

profile pictureAWS
专家
Uri
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则