feat: 🎸 optional enable cross zone lb #88
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This optimisation will only be disabled on the 'production-only' ingress
We can disable cross-zone load balancing because the nlb is created in each subnet, so traffic will still be able to reach each az. It is also worth mentioning that cross-zone load balancing for nlb is disabled by default.
Diagram overview
disabled:
vs.
enabled:
Why
We want to be able to toggle cross-zone load balancing because it can introduce connection resets when a connection is mistakenly identified as originating from a duplicate source.
Disadvantages
The disadvantage of disabling cross-zone load balancing is if a client caches the DNS of the lb it could result in lbs receiving "disproportionally higher number of inbound requests"
Advantages
Benefits include fewer connection resets, marginally reduced latency (not crossing AZs) and reduced regional data transfer charges
Dig
You can see the nlb in each subnet az with dig below: