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

Checking for DPUs in platform.json is adding delay to WR/FR reconciliation #20284

Open
vivekrnv opened this issue Sep 17, 2024 · 3 comments
Open

Comments

@vivekrnv
Copy link
Contributor

vivekrnv commented Sep 17, 2024

Description

In 202405 and above, two extra steps are added before the start of every container which checks NUM_DPU and IS_DPU_DEVICE by parsing the platform.json file using the jq tool. This is only relevant for Smartswitch. However, this is adding some delay during the reconciliation phase of WR/FR resulting

    # Parse the platform.json file to get the platform specific information
    PLATFORM_JSON=/usr/share/sonic/device/$PLATFORM/platform.json
    if [ -f "$PLATFORM_JSON" ]; then
        NUM_DPU=$(jq -r '.DPUS | length' $PLATFORM_JSON 2>/dev/null)
        jq -e '.DPU' $PLATFORM_JSON >/dev/null
        if [[ $? -eq 0 ]]; then
            IS_DPU_DEVICE="true"
        else
            IS_DPU_DEVICE="false"
        fi
    fi

When there is load on CPU, both the jq calls are adding > 1 sec to the start of swss and almost 0.5 sec to the start of syncd. There are also present in teamd and bgp container start flow which may cause extra contention on the CPU.

swss start
image

syncd start
image

These 1.5 - 2 sec can be avoided as this can be optimized. Ideally, this should be read once maybe in the rc.local script and the values must be saved in some file like sonic-environment etc and should be read during the start of every container

Note: All the values were taken from MSN2700 platform, Intel Celeron 2 core CPU

@vivekrnv
Copy link
Contributor Author

@vaibhavhd FYI

@prgeor prgeor added the MSFT label Sep 17, 2024
@Pterosaur
Copy link
Contributor

Hi @vivekrnv , could you teach me how you got this timeline graph and which tool and commands you were using?

I will try to optimize it.

@vivekrnv
Copy link
Contributor Author

vivekrnv commented Sep 18, 2024

Hi, you can use sonic-bootchart.

Run sonic-bootchart enable before the warm-reboot. After the warm-reboot, you can run sonic-bootchart show. which'll show the output svg path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants