Skip to content

Improve performance of the NOS driver#74

Open
naved001 wants to merge 3 commits intoansible-network:develfrom
naved001:vdx-nos/improve-performance
Open

Improve performance of the NOS driver#74
naved001 wants to merge 3 commits intoansible-network:develfrom
naved001:vdx-nos/improve-performance

Conversation

@naved001
Copy link
Copy Markdown
Contributor

Without these optimizations, it was taking around 9-10 minutes to configure a a switchport in access mode. The commits in this PR cuts this down by half. There are 2 major changes:

  1. I noticed that the nos community plugin tries to get the host-name of the switch for every call show running-config | include host-name. In our case, because the switches are stacked this returns the configuration from all of our 8 stacked switches which takes a while to generate. By setting match to none, it ignores comparing[1] the source config and running config.
  2. I decided to batch all the commands together so we push all commands to the switch at once instead of multiple round trips.

Not sure if this has a place in this repository as the driver without the optimizations maybe okay for people who don't have their switches stacked, but I wanted to submit this in case folks are interested.

[1] https://docs.ansible.com/ansible/latest/collections/community/network/nos_config_module.html#parameter-match

@softwarefactory-project-zuul
Copy link
Copy Markdown

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/bb03ad6a0c0047b38ff7e503a99d5fde

✔️ ansible-tox-py36 SUCCESS in 4m 05s
✔️ ansible-tox-py38 SUCCESS in 11m 38s
✔️ ansible-tox-py39 SUCCESS in 11m 10s
✔️ ansible-tox-linters SUCCESS in 11m 00s

Copy link
Copy Markdown
Contributor

@tzumainn tzumainn left a comment

Choose a reason for hiding this comment

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

These changes worked for me, reducing operations from nearly 12 minutes to something closer to 6 minutes!

@tzumainn
Copy link
Copy Markdown
Contributor

@NilashishC hi! I saw you helped on the previous PR for the NOS driver; is it possible to help with this one as well? Thanks!

@radez radez added the gate Gate PR in Zuul CI label Feb 21, 2023
@radez radez added the mergeit label Mar 29, 2023
DanNiESh added a commit to CCI-MOC/network-runner that referenced this pull request Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gate Gate PR in Zuul CI mergeit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants