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?

posta 2 anni fa2067 visualizzazioni
3 Risposte
3
Risposta accettata

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
con risposta 2 anni fa
profile pictureAWS
ESPERTO
verificato 2 anni fa
profile pictureAWS
ESPERTO
verificato 2 anni fa
  • 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
ESPERTO
con risposta 2 anni fa
  • 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
ESPERTO
Uri
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande