-
Notifications
You must be signed in to change notification settings - Fork 739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Infra][add/remove topo] Improve vm_topology
performance
#16230
Open
lolyu
wants to merge
3
commits into
sonic-net:master
Choose a base branch
from
lolyu:improve_vm_topology
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+184
−8
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Longxiang <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
lolyu
force-pushed
the
improve_vm_topology
branch
from
December 26, 2024 05:23
12c0a77
to
fa6b408
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Longxiang <[email protected]>
lolyu
force-pushed
the
improve_vm_topology
branch
from
December 26, 2024 05:24
fa6b408
to
14b8df8
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
lolyu
changed the title
Improve
[Infra][add/remove topo] Improve Dec 26, 2024
vm_topology
performancevm_topology
performance
Signed-off-by: Longxiang <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of PR
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
vm_topology
builds up the testbed connections (veth
links, ovs bridges, etc) on the test server by running Linux commands, which involves a lot of waiting for I/O operations.vm_topology
script running statistics withrestart-ptf
:With the I/O bound nature,
vm_topology
runtime could be greatly decreased by using threading pool to parallelize the I/O operations.Signed-off-by: Longxiang [email protected]
How did you do it?
Introduce the thread pool to
vm_topology
to parallel run functions that take time to finish.restart-ptf
ondualtor-120
vm_topology
profile statistics:Top three total run time function call:
add_host_ports
bind_fp_ports
init
remove-topo
ondualtor-120
vm_topology
profile statistics:remove_host_ports
unbind_fp_ports
remove_injected_fp_ports_from_docker
Let's use thread pool to parallel run the following functions that take most of time from the above statistics:
add_host_ports
remove_host_ports
bind_fp_ports
unbind_fp_ports
Two new classes are introduced to support this feature:
VMTopologyWorker
: a worker class to support work in either single thread mode or thread pool mode.ThreadBufferHandler
: a logging handler to buffer logs from each task submitted to theVMTopologyWorker
and flush when the task ends. This is to ensurevm_topology
logs are grouped by the tasks, logs from different tasks will not be mixed together.How did you verify/test it?
Let's test this PR on a
dualtor-120
testbed with this PR, and the thread pool has 13 thread workers.vm_topology
run time without this PRvm_topology
run time with this PRremove-topo
restart-ptf
restart-ptf
with-this-PRvm_topology
profile statistics:add_host_ports
bind_fp_ports
remove-topo
with-this-pRvm_topology
profile statistics:remove_host_ports
unbind_fp_ports
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation