Lambda doesn’t consume a lot of IPs even though it executes in parallel.

wqwq
2 min readJun 9, 2024

--

Introduction

Lambda can automatically scale depending on traffic and can execute in parallel. Initially, I thought Lambda consumes a lot of IPs. This problem is that we can’t scale anymore, and other resources also can’t scale. But the result is different. So I want to write about this.

Conclusion

Lambda doesn’t consume a lot of IPs even though it executes in parallel.

Understanding Hyperplane ENI

To understand the above conclusion, we need to understand Hyperplane ENI. This role is to limit the number of IP addresses used within a subnet is possible.

Component

The process is as follows. Lambda first accesses Lambda’s NAT, then access ENI. So Lambda can use ENI effectively.

In an article by https://aws.amazon.com/jp/blogs/news/announcing-improved-vpc-networking-for-aws-lambda-functions/

How do we calculate IP addresses?

In the above case, how many IP addresses does the Lambda function consume? The answer is 「subnet * security group = 1 eni(=1 IP address)」. For example,

  • 1 subnet * 2 security group = 2IP
  • 2 subnet * 3security group = 6IP

If we deploy different Lambda in the same subnet and security group, it will use shared Hyperplane ENI. Besides there is no quota on the number of Lambda that can use the same Hyperplane ENI.

Reference

--

--