Skip to content
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

[202205] [generate_dump] Optimize the execution time of the 'show techsupport' script to 5-10% by reducing calls to the 'tar append' operation #2562

Conversation

vadymhlushko-mlnx
Copy link
Contributor

Signed-off-by: Vadym Hlushko vadymh@nvidia.com

What I did

Optimize the execution time of the 'show techsupport' script to 5-10%.

How I did it

The show techsupport CLI command calls the generate_dump bash script. In the script, there are a many functions that do the next scenario:

1. Run some CLI command
2. Save output from step 1 to the temporary file
3. Append the temporary file from step 2 to the `/var/dump/sonic_dump_XXXX.tar` file
4. Delete the temporary file from step 2

This PR removes the 3 and 4 step from those functions and creates a new function save_to_tar() which will add to .tar archive the whole directory with temporary files (which means it will not spawn a tar -v -rhf ... process for each temporary file)

How to verify it

Run the time show techsupport CLI command and compare the execution time to the original script, the execution time will be decreased by 5-10%.

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

… script to 5-10% by reducing calls to the 'tar append' operation

Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
@liat-grozovik liat-grozovik merged commit 93172c4 into sonic-net:202205 Dec 20, 2022
dgsudharsan added a commit to dgsudharsan/sonic-buildimage that referenced this pull request Dec 20, 2022
Update sonic-utilities submodule pointer to include the following:
* 67cbb15 [202205]Fixes sonic-net#12170: Delete subinterface and recreate the subinterface in default-vrf ([sonic-net#2564](sonic-net/sonic-utilities#2564))
* 93172c4 [202205] [generate_dump] Optimize the execution time of the 'show techsupport' script to 5-10% by reducing calls to the 'tar append' operation ([sonic-net#2562](sonic-net/sonic-utilities#2562))

Signed-off-by: dgsudharsan <sudharsand@nvidia.com>
dprital added a commit to dprital/sonic-buildimage that referenced this pull request Dec 26, 2022
Update sonic-utilities submodule pointer to include the following:
* f7988b0 [202205] [timer.unit.j2] use wanted-by in timer unit ([sonic-net#2561](sonic-net/sonic-utilities#2561))
* f45dcfb [generate_dump] Optimize the execution time of 'show techsupport' CLI by paraller function execution ([sonic-net#2565](sonic-net/sonic-utilities#2565))
* 67cbb15 [202205]Fixes sonic-net#12170: Delete subinterface and recreate the subinterface in default-vrf ([sonic-net#2564](sonic-net/sonic-utilities#2564))
* 93172c4 [202205] [generate_dump] Optimize the execution time of the 'show techsupport' script to 5-10% by reducing calls to the 'tar append' operation ([sonic-net#2562](sonic-net/sonic-utilities#2562))

Signed-off-by: dprital <drorp@nvidia.com>
vadymhlushko-mlnx added a commit to vadymhlushko-mlnx/sonic-utilities that referenced this pull request Jan 5, 2023
"[202205][generate_dump] Fix for a deletion flow for all secret files in the techsupport dump (sonic-net#2572)"
"[generate_dump] Optimize the execution time of 'show techsupport' CLI by paraller function execution (sonic-net#2565)"
"[202205] [generate_dump] Optimize the execution time of the 'show techsupport' script to 5-10% by reducing calls to the 'tar append' operation (sonic-net#2562)"

This reverts commits
e1c8243
f45dcfb
93172c4
liat-grozovik pushed a commit that referenced this pull request Jan 5, 2023
- What I did
Reverted PRs because they caused the degradation that some files are missing in show techsupport archive.

- How I did it
Reverts the following 
e1c8243 [202205][generate_dump] Fix for a deletion flow for all secret files in the techsupport dump (#2572)
f45dcfb [generate_dump] Optimize the execution time of 'show techsupport' CLI by paraller function execution (#2565)
93172c4 [202205] [generate_dump] Optimize the execution time of the 'show techsupport' script to 5-10% by reducing calls to the 'tar append' operation (#2562)
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.

2 participants