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

[action] [PR:17342] [config-chassisdb] use cached variables #17967

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

mssonicbld
Copy link
Collaborator

No cache:

root@arc-switch1004:/home/admin# time bash -x /usr/bin/config-chassisdb
+ config_chassis_db
+ startdb_file=/etc/sonic/chassisdb.conf
+ '[' '!' -e /etc/sonic/chassisdb.conf ']'
++ sonic-cfggen -H -v DEVICE_METADATA.localhost.platform
+ platform=x86_64-mlnx_msn2700-r0
+ chassis_config=/usr/share/sonic/device/x86_64-mlnx_msn2700-r0/chassisdb.conf
+ '[' '!' -e /usr/share/sonic/device/x86_64-mlnx_msn2700-r0/chassisdb.conf ']'
+ echo 'no chassisdb.conf found, bypass config-chassisdb service'
no chassisdb.conf found, bypass config-chassisdb service
+ exit 0

real 0m0.512s
user 0m0.429s
sys 0m0.058s

With cache:

root@arc-switch1004:/home/admin# time bash -x /usr/bin/config-chassisdb
+ '[' -f /etc/sonic/sonic-environment ']'
+ . /etc/sonic/sonic-environment
++ SONIC_VERSION=202305_RC.32-da745b71d_Internal
++ PLATFORM=x86_64-mlnx_msn2700-r0
++ HWSKU=Mellanox-SN2700-D48C8
++ DEVICE_TYPE=ToRRouter
++ ASIC_TYPE=mellanox
+ config_chassis_db
+ startdb_file=/etc/sonic/chassisdb.conf
+ '[' '!' -e /etc/sonic/chassisdb.conf ']'
+ platform=x86_64-mlnx_msn2700-r0
+ chassis_config=/usr/share/sonic/device/x86_64-mlnx_msn2700-r0/chassisdb.conf
+ '[' '!' -e /usr/share/sonic/device/x86_64-mlnx_msn2700-r0/chassisdb.conf ']'
+ echo 'no chassisdb.conf found, bypass config-chassisdb service'
no chassisdb.conf found, bypass config-chassisdb service
+ exit 0

real 0m0.017s
user 0m0.005s
sys 0m0.008s

Why I did it

Improve boot performance mostly needed for fast and warmboot

Work item tracking
  • Microsoft ADO (number only):

How I did it

Use cached variable.

How to verify it

Boot the system. Simply do "systemd-analyze blame" and look at service start time.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202311

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

- Why I did it
Improve boot performance mostly needed for fast and warmboot

- How I did it
Use cached variable.

- How to verify it
Boot the system. Simply do "systemd-analyze blame" and look at service start time.

Signed-off-by: Stepan Blyschak <[email protected]>
@mssonicbld
Copy link
Collaborator Author

Original PR: #17342

@mssonicbld mssonicbld merged commit 23190ad into sonic-net:202311 Feb 1, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants