Skip to content

Conversation

heypnus
Copy link
Contributor

@heypnus heypnus commented Sep 23, 2025

Enhancement on the SubnetPort realization performance

  1. Avoid the uncessary SubnetPort state check if the stauts indicates that
    the port has been realized successfully.
  2. Get the Subnet's gateway address from Subnet store instead of Subnet
    status API to reduce the frequency of NSX API calls.

Testing done:

  1. Created 3000 ports in the single Subnet (ipv4SubnetSize=4096), it took
    34 minutes to complete the realization(previously the time is > 90 minutes).
  2. Created 3000 ports in the defualt SubnetSet (ipv4SubnetSize=32), it took
    36 minutes to complete the realization.

@heypnus
Copy link
Contributor Author

heypnus commented Sep 25, 2025

/e2e

@heypnus heypnus force-pushed the performance/subnet_status branch 6 times, most recently from e9018fc to def89e6 Compare September 25, 2025 12:39
@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.48%. Comparing base (e4571c5) to head (dfd3a8a).

Files with missing lines Patch % Lines
pkg/nsx/services/subnetport/subnetport.go 70.58% 12 Missing and 3 partials ⚠️
...kg/controllers/subnetport/subnetport_controller.go 80.76% 4 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1250      +/-   ##
==========================================
- Coverage   74.50%   74.48%   -0.03%     
==========================================
  Files         147      147              
  Lines       23501    23527      +26     
==========================================
+ Hits        17509    17523      +14     
- Misses       4910     4920      +10     
- Partials     1082     1084       +2     
Flag Coverage Δ
unit-tests 74.48% <80.00%> (-0.03%) ⬇️
Files with missing lines Coverage Δ
...g/controllers/namespace/subnet_share_controller.go 63.34% <100.00%> (ø)
pkg/controllers/subnet/subnet_controller.go 70.54% <100.00%> (ø)
pkg/nsx/services/ipblocksinfo/ipblocksinfo.go 82.81% <100.00%> (ø)
pkg/nsx/services/subnet/subnet.go 74.39% <100.00%> (+0.22%) ⬆️
...kg/controllers/subnetport/subnetport_controller.go 65.77% <80.76%> (+0.04%) ⬆️
pkg/nsx/services/subnetport/subnetport.go 80.81% <70.58%> (-2.06%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@heypnus heypnus force-pushed the performance/subnet_status branch from def89e6 to f332d28 Compare September 26, 2025 06:13
@heypnus heypnus force-pushed the performance/subnet_status branch from f332d28 to 9096bc8 Compare September 26, 2025 07:16
@heypnus heypnus force-pushed the performance/subnet_status branch from 9096bc8 to 126df80 Compare September 26, 2025 12:59
@heypnus heypnus requested a review from TaoZou1 September 26, 2025 14:04
@dantingl
Copy link
Collaborator

dantingl commented Sep 28, 2025

Get the Subnet's gateway address from Subnet store instead of Subnet status API to reduce the frequency of NSX API calls.

Can you confirm Subnet response API can return gateway address and network address in 9.0 as well?

@heypnus heypnus force-pushed the performance/subnet_status branch from 126df80 to e15e50a Compare September 28, 2025 06:52
dantingl
dantingl previously approved these changes Sep 28, 2025
@heypnus heypnus force-pushed the performance/subnet_status branch from e15e50a to 3774f7c Compare September 28, 2025 15:15
@heypnus heypnus force-pushed the performance/subnet_status branch 3 times, most recently from e183faf to ac050ac Compare September 28, 2025 16:40
@heypnus
Copy link
Contributor Author

heypnus commented Sep 28, 2025

/e2e

1 similar comment
@heypnus
Copy link
Contributor Author

heypnus commented Sep 28, 2025

/e2e

@heypnus heypnus force-pushed the performance/subnet_status branch from ac050ac to 1305f48 Compare September 29, 2025 05:22
@heypnus heypnus force-pushed the performance/subnet_status branch from 1305f48 to c445047 Compare September 29, 2025 17:45
@heypnus heypnus force-pushed the performance/subnet_status branch 3 times, most recently from 25aef6c to ade8787 Compare September 30, 2025 02:39
1. Avoid the uncessary SubnetPort state check if the stauts indicates that
the port has been realized successfully.
2. Get the Subnet's gateway address from Subnet store instead of Subnet
status API to reduce the frequency of NSX API calls.

Testing done:
1. Created 3000 ports in the single Subnet (ipv4SubnetSize=4096), it took
34 minutes to complete the realization(previously the time is > 90 minutes).
2. Created 3000 ports in the defualt SubnetSet (ipv4SubnetSize=32), it took
36 minutes to complete the realization.
@heypnus heypnus force-pushed the performance/subnet_status branch from ade8787 to dfd3a8a Compare September 30, 2025 05:27
Copy link
Contributor

@yanjunz97 yanjunz97 left a comment

Choose a reason for hiding this comment

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

Overalll LGTM. Just a thought for future changes.

@heypnus heypnus merged commit f0c5eca into vmware-tanzu:main Sep 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants