Root cause is that for any show/config cli command, all python modules are imported.
Some modules are not related for current executed command, but still loaded by default.
Pls check below importtime output.
Since then a lot of new commands and python modules have been introduced to
sonic-utilities repository and we are facing similar performance issue with latest master.
SONIC version : master
Platform : arm64, armhf
Steps to reproduce the issue
1.
2.
3.
Describe the results you received
admin@sonic:~$ time show interfaces status
:
:
**real 0m5.007s**
user 0m3.664s
sys 0m0.746s
admin@sonic:~$ time show acl table
Name Type Binding Description Stage
------ ------ --------- ------------- -------
**real 0m4.918s**
user 0m3.546s
sys 0m0.762s
admin@sonic:~$ time show ipv6 interfaces
:
:
**real 0m6.256s**
user 0m3.752s
sys 0m2.504s
Describe the results you expected
Additional information you deem important (e.g. issue happens only occasionally)
Description
Root cause is that for any show/config cli command, all python modules are imported. Some modules are not related for current executed command, but still loaded by default. Pls check below importtime output.
We faced similar issue with 202012 and raised a below PR to move some python imports inside specific commands. https://github.com/sonic-net/sonic-utilities/pull/1202
Since then a lot of new commands and python modules have been introduced to sonic-utilities repository and we are facing similar performance issue with latest master.
SONIC version : master Platform : arm64, armhf
Steps to reproduce the issue
1. 2. 3.
Describe the results you received
Describe the results you expected
Additional information you deem important (e.g. issue happens only occasionally)
Output of
show version