Skip to content

[flex-counters] [202012] Delay flex counters stats init for faster boot time#1750

Closed
shlomibitton wants to merge 2 commits intosonic-net:202012from
shlomibitton:delay_flex_counters_202012
Closed

[flex-counters] [202012] Delay flex counters stats init for faster boot time#1750
shlomibitton wants to merge 2 commits intosonic-net:202012from
shlomibitton:delay_flex_counters_202012

Conversation

@shlomibitton
Copy link
Contributor

Signed-off-by: Shlomi Bitton shlomibi@nvidia.com

What I did
Update flex counters DB with counters stats only when counters are enabled.
As long as the polling counters are not enabled, flex counters information will stored internally on PortsOrch.

Why I did it
Creating flex counters objects on the DB will trigger 'SYNCD' to access the HW for query statistics capabilities.
This HW access takes time and will be better to finish boot before doing this (mainly for fast-reboot but good to have in general).
The flex counters are not crucial at boot time, we can delay it to the end of the boot process.

How I verified it
Reboot a switch and observer the flex counters DB populated after counters are enabled.

Details if related

@liat-grozovik
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik liat-grozovik requested a review from tahmed-dev May 31, 2021 08:12
@liat-grozovik
Copy link
Collaborator

@tahmed-dev and @qiluo-msft we believe this can improve performance for any boot but specially for fastboot.
Can you please review and provide your feedback?

Add flex counters unit-test

Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
@liat-grozovik
Copy link
Collaborator

@qiluo-msft kindly reminder. we need the fix merged in order to test fastboot and get some improvements.

@qiluo-msft
Copy link
Contributor

Please update this PR according to the iterations in #1749

@qiluo-msft
Copy link
Contributor

Can we cleanly cherry-pick #1749?

@shlomibitton
Copy link
Contributor Author

@qiluo-msft fixed the PR according to the comments on master.
Previously I tried to cherry-pick and it didn't apply cleanly, this is why I created this additional PR.

@qiluo-msft
Copy link
Contributor

Close this one because the master branch PR #1749 was reverted.
You can reopen if you want to update with new solution.

@qiluo-msft qiluo-msft closed this Jun 21, 2021
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
#### What I did

Depends on [sonic-swss-common/pull/330](sonic-net/sonic-swss-common#330)

According to [HLD](https://github.com/Azure/SONiC/blob/master/doc/rates-and-utilization/Rates_and_utilization_HLD.md) added calculation of rates and utilization columns to the `portstat` and `intfstat` scripts output

#### How I did it

Modified the `portstat` and `intfstat` scripts

#### How to verify it

Added UT

#### Previous command output (if the output of a command-line utility has changed)

```
admin@sonic:~$ show int count
      IFACE    STATE    RX_OK    RX_BPS    RX_UTIL    RX_ERR    RX_DRP    RX_OVR    TX_OK    TX_BPS    TX_UTIL    TX_ERR    TX_DRP    TX_OVR
-----------  -------  -------  --------  ---------  --------  --------  --------  -------  --------  ---------  --------  --------  --------
  Ethernet0        X        0       N/A        N/A         0         0       N/A        0       N/A        N/A         0         0       N/A
  Ethernet2        U      287       N/A        N/A         0         0       N/A      818       N/A        N/A         0         0       N/A
  Ethernet4        U      380       N/A        N/A         0         0       N/A      858       N/A        N/A         0         0       N/A
  Ethernet6        U      286       N/A        N/A         0         0       N/A      850       N/A        N/A         0         0       N/A
```

#### New command output (if the output of a command-line utility has changed)

```
admin@sonic:~$ show int count
      IFACE    STATE    RX_OK      RX_BPS    RX_UTIL    RX_ERR    RX_DRP    RX_OVR    TX_OK      TX_BPS    TX_UTIL    TX_ERR    TX_DRP    TX_OVR
-----------  -------  -------  ----------  ---------  --------  --------  --------  -------  ----------  ---------  --------  --------  --------
  Ethernet0        X        0    0.00 B/s      0.00%         0         0       N/A        0    0.00 B/s      0.00%         0         0       N/A
  Ethernet2        U        0    0.00 B/s      0.00%         0         0       N/A        0    0.00 B/s      0.00%         0         0       N/A
  Ethernet4        U        0    0.00 B/s      0.00%         0         0       N/A        0    0.00 B/s      0.00%         0         0       N/A
  Ethernet6        U        0    0.00 B/s      0.00%         0         0       N/A        0    0.00 B/s      0.00%         0         0       N/A
```
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.

3 participants