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?

asked 2 years ago2147 views
3 Answers
3
Accepted Answer

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
answered 2 years ago
profile pictureAWS
EXPERT
reviewed 2 years ago
profile pictureAWS
EXPERT
reviewed 2 years ago
  • 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
EXPERT
answered 2 years ago
  • 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
EXPERT
Uri
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions