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 'show techsupport' CLI by paraller function execution #2565

Conversation

vadymhlushko-mlnx
Copy link
Contributor

DEPENDS ON: sonic-utilities/pull/2562

Signed-off-by: Vadym Hlushko [email protected]

What I did

Optimize the execution time of the 'show techsupport' script.

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 will add the execution of these functions in parallel manner. Also, it will not spawn too many processes to not waste all CPU time.

How to verify it

First test scenario

Run the `time show techsupport` CLI command and compare the execution time to the original script (with no parallelism), the execution time will be decreased by 10-20%.

Second test scenario

1. Stuck the FW by using next commands
	a. mcra /dev/mst/mt52100_pci_cr0 0xa01e4 0x10
	b. mcra /dev/mst/mt52100_pci_cr0 0xa05e4 0x10
	c. mcra /dev/mst/mt52100_pci_cr0 0xa07e4 0x10
	d. mcra /dev/mst/mt52100_pci_cr0 0xa09e4 0x10
	e. mcra /dev/mst/mt52100_pci_cr0 0xa0be4 0x10
	f. mcra /dev/mst/mt52100_pci_cr0 0xa0de4 0x10
	g. mcra /dev/mst/mt52100_pci_cr0 0xa0fe4 0x10
2. Run the `time show techsupport` CLI command and compare the execution time to the original script (with no parallelism), the execution time will be decreased by up to 50% because inside the script we launch CLI commands with `timeout --foreground 5m`. 

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)

… by paraller function execution

Signed-off-by: Vadym Hlushko <[email protected]>
@liat-grozovik liat-grozovik merged commit f45dcfb into sonic-net:202205 Dec 26, 2022
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 <[email protected]>
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