Skip to content

fix: [M3-10679] - NodeBalancer Configuration form unresponsiveness for larger VPC deployments#12991

Merged
bnussman-akamai merged 10 commits intolinode:developfrom
bnussman-akamai:fix/nodebalancer-vpc-performance
Oct 16, 2025
Merged

fix: [M3-10679] - NodeBalancer Configuration form unresponsiveness for larger VPC deployments#12991
bnussman-akamai merged 10 commits intolinode:developfrom
bnussman-akamai:fix/nodebalancer-vpc-performance

Conversation

@bnussman-akamai
Copy link
Copy Markdown
Member

@bnussman-akamai bnussman-akamai commented Oct 15, 2025

Description 📝

This PR fix unresponsiveness on the NodeBalancer configurations page for larger NodeBalancer + VPC deployments but also includes some other fixes too.

Fixes 🔧

  • Fixes problematic "n + 1" data fetching on the NodeBalancer Configurations page (primary fix 🔧 )
  • Fixes missing input IDs causing accessibility issues with NodeBalancer Port and Weight fields
  • Fixes missing React Query cache invalidation

Scope 🚢

Upon production release, changes in this PR will be visible to:

  • All customers
  • Some customers (e.g. in Beta or Limited Availability)
  • No customers / Not applicable

Preview 📷

Before After
Screenshot 2025-10-15 at 4 04 21 PM Screenshot 2025-10-15 at 4 03 16 PM
Makes 1 request per Linode (in the region) to /v4/linode/instaces/:id/ips. This was resulting in +400 requests to the API at once for a customer Uses 1 request to /v4beta/vpcs/:id/ips

How to test 🧪

Prerequisites

  • Create a NodeBalancer that uses a VPC
  • Create some Linodes in the same VPC
  • Add those Linodes as NodeBalancer nodes

Reproduction steps

To replicate the performance issues, you need a large account, but you can still test this PR with any size account to ensure Cloud Manager still works as expected.

Verification steps

  • Test functionality and performance of the NodeBalancer Configuration form (create page and details page)
  • This PR's changes should be transparent to the user. Verify functionality is the same as prodiction.
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All tests and CI checks are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@bnussman-akamai bnussman-akamai self-assigned this Oct 15, 2025
@bnussman-akamai bnussman-akamai added Bug Fixes for regressions or bugs VPC Relating to VPC project NodeBalancers Relating to NodeBalancers labels Oct 15, 2025
Comment on lines -36 to -44
const linodeIPQueries = useQueries({
queries:
linodesData?.map<UseQueryOptions<LinodeIPsResponse, APIError[]>>(
({ id }) => ({
...linodeQueries.linode(id)._ctx.ips,
enabled: isSubnetSelected,
})
) ?? [],
});
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the problematic code causing performance issues. The code itself is fine, but isn't scaling well for customers that have hundres of Linodes.

I was able to remove this and use useVPCIPsQuery (/v4beta/vpcs/:id/ips) instead

Comment on lines 30 to -34
const {
data: subnetsData,
error: subnetsError,
isLoading: subnetsIsLoading,
} = useSubnetsQuery(Number(vpcId), {}, {}, isSubnetSelected);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the primary fix but...

Using useSubnetsQuery here would cause bugs for VPCs with more than 100 subnets (100 is the default API page size). useSubnetsQuery is paginated but getVPCIPOptions expects all subnets to be passed.

I removed useSubnetsQuery and replaced it with useVPCQuery which includes a subnets field, which includes all subnets in the VPC. This will eliminate the possibility of bugs for VPCs with more than 100 subnets .

disabled={disabled}
errorGroup={`${configIdx}`}
errorText={nodesErrorMap.port}
inputId={`node-port-${configIdx}-${idx}`}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added inputIds to fix this issue:

Screen.Recording.2025-10-15.at.4.24.55.PM.mov

},
queryKey: null,
},
vpcIps: (vpcId: number, filter: Filter = {}) => ({
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need vpcId duplicated here. vpcId is already in scope

});
}

return options.sort((a, b) => a.label.localeCompare(b.label));
Copy link
Copy Markdown
Member Author

@bnussman-akamai bnussman-akamai Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API's default sorting is actually much nicer so I removed our client side sort call here.

With the sort call (Prod) Without the sort (This PR)
Image Image

@bnussman-akamai bnussman-akamai marked this pull request as ready for review October 15, 2025 20:36
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner October 15, 2025 20:36
@bnussman-akamai bnussman-akamai added the Related Cypress Test Failure Test failure(s) are the result of changes in this PR and must be addressed before merging. label Oct 15, 2025
Copy link
Copy Markdown
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thanks for the fixes - they all make sense to me.

While not being able to fully test it, did not notice any regressions

@bnussman-akamai bnussman-akamai requested a review from a team as a code owner October 16, 2025 16:10
@bnussman-akamai bnussman-akamai requested review from cliu-akamai and removed request for a team October 16, 2025 16:10
@bnussman-akamai bnussman-akamai removed the Related Cypress Test Failure Test failure(s) are the result of changes in this PR and must be addressed before merging. label Oct 16, 2025
Copy link
Copy Markdown
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ✅
No regressions observed ✅
/v4/linode/instaces/:id/ips --> /v4beta/vpcs/:id/ips swap verified ✅

@github-project-automation github-project-automation bot moved this from Review to Approved in Cloud Manager Oct 16, 2025
bnussman-akamai and others added 3 commits October 16, 2025 14:07
Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
@linode-gh-bot
Copy link
Copy Markdown
Collaborator

Cloud Manager UI test results

🔺 5 failing tests on test run #6 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
5 Failing834 Passing13 Skipped40m 13s

Details

Failing Tests
SpecTest
access-key.e2e.spec.tsCloud Manager Cypress Tests→object storage access key end-to-end tests » "before all" hook for "can create an access key with unlimited access - e2e"
clone-linode.spec.tsCloud Manager Cypress Tests→clone linode » can clone a Linode from Linode details page
object-storage-objects-multicluster.spec.tsCloud Manager Cypress Tests→Object Storage Multicluster objects » "before all" hook for "can upload, access, and delete objects"
timerange-verification.spec.tsCloud Manager Cypress Tests→Integration tests for verifying Cloudpulse custom and preset configurations » should implement and validate custom date/time picker for a specific date and time range
object-storage.e2e.spec.tsCloud Manager Cypress Tests→object storage end-to-end tests » "before all" hook for "can create and delete object storage buckets"

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/objectStorage/access-key.e2e.spec.ts,cypress/e2e/core/linodes/clone-linode.spec.ts,cypress/e2e/core/objectStorageMulticluster/object-storage-objects-multicluster.spec.ts,cypress/e2e/core/cloudpulse/timerange-verification.spec.ts,cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts"

@bnussman-akamai bnussman-akamai merged commit 51444b7 into linode:develop Oct 16, 2025
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Cloud Manager Oct 16, 2025
corya-akamai pushed a commit to corya-akamai/manager that referenced this pull request Dec 8, 2025
…r larger VPC deployments (linode#12991)

* use vpc ips endpoint (work in progress)

* improve things more

* clean up

* fix typecheck

* other bug fixes

* Added changeset: NodeBalancer Configuration form unresponsiveness for larger VPC deployments

* update cypress tests

* make code a bit safer

* Apply suggestion from @dwiley-akamai

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>

* Apply suggestion from @dwiley-akamai

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>

---------

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fixes for regressions or bugs NodeBalancers Relating to NodeBalancers VPC Relating to VPC project

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants