AWS ENI IPAM: Reduce API calls during ENI creation when using IP prefix delegation#44154
Conversation
|
/test |
|
Hi @liyihuang, Thanks for the review :) We're on v1.17.5 right now and planning to upgrade to 1.18.x soon. I Checked out PRs you mentioned, they look great and should help us a lot! Once we upgrade and get those other fixes too, hoping to see it drop even further! Thanks for pointing those out! More context on this PROur main pain point was
So I made this change to reduce the total API calls when creating new ENIs. Tested it in our UAT env and saw our pod scale-out P99 latency time go from 30 mins -> 5 mins, and no more throttling. [ img 2 - after ]
|
|
Oh, they are on 1.19. but I also have to admit that it doesn't resolve your issue if you run into the rate limit for the assigning IP address. |
ada5692 to
788365f
Compare
|
@sh1un you need to check out and fix https://github.com/cilium/cilium/actions/runs/21902051015/job/63233593561?pr=44154 |
788365f to
852ae99
Compare
@liyihuang |
|
/test |
When using prefix delegation mode, the CreateInterface function was limiting the number of IPs to allocate based on the per-ENI secondary IP limit (limits.IPv4-1). This caused the operator to make additional API calls to AssignPrivateIpAddresses to allocate remaining prefixes. This change removes the secondary IP limit restriction for prefix delegation mode, allowing CreateNetworkInterface to request all needed prefixes in a single API call. This reduces API calls and potential race conditions during ENI creation. Signed-off-by: Shiun Chiu <shiun.chiu@shopline.com>
852ae99 to
046a1da
Compare
|
/test |



Background
Hi Cilium team! I'm an engineer at an e-commerce company that uses Cilium with AWS ENI IPAM.
We are currently experiencing slow pod scaling issues in our production environment. Our goal is to reduce pod scale-out latency, which is constrained by AWS API rate limits when using ENI IPAM.
To achieve faster scaling while staying within AWS rate limits, we want to minimize the number of API calls required to reach the expected state.
For example:
Problem
When using AWS ENI IPAM with IP prefix delegation mode (e.g.,
min-allocate: 45):CreateNetworkInterfaceonly requested a limited number of prefixes (capped bylimits.IPv4-1)cilium/pkg/aws/eni/node.go
Lines 595 to 596 in 75421ca
AssignPrivateIpAddressescalls were needed for remaining prefixesSolution
Remove the per-ENI secondary IP limit for prefix delegation mode, allowing all needed prefixes to be requested in the initial
CreateNetworkInterfacecall.Before (with min-allocate: 45):
CreateNetworkInterfacewithipv4PrefixCount=1AssignPrivateIpAddresseswithipv4PrefixCount=2→ 2 API calls
After (with this change):
CreateNetworkInterfacewithipv4PrefixCount=3→ 1 API call
Testing
CreateNetworkInterfacenow requests the correct number of prefixes in a single call