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

[config-chassisdb] use cached variables #17342

Merged

Conversation

stepanblyschak
Copy link
Collaborator

@stepanblyschak stepanblyschak commented Nov 29, 2023

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)

@liat-grozovik
Copy link
Collaborator

@saiarcot895 @bingwang-ms could you please help to review?
this is needed for 202305 to fix some upgrade issues

@liat-grozovik liat-grozovik merged commit 9555883 into sonic-net:master Dec 7, 2023
20 checks passed
@dgsudharsan
Copy link
Collaborator

@StormLiangMS Tested on top of 202305 commit 2b8efdb

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Dec 9, 2023
- 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

Cherry-pick PR to 202305: #17464

mssonicbld pushed a commit that referenced this pull request Dec 9, 2023
- 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 pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Jan 31, 2024
- 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

Cherry-pick PR to 202311: #17967

mssonicbld pushed a commit that referenced this pull request Feb 1, 2024
- 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]>
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.

7 participants