-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Incorrect rate values in counters_db rates table populated through rates lua script #8392
Comments
@abdosi FYI. |
This was referenced Aug 11, 2021
qiluo-msft
pushed a commit
to sonic-net/sonic-sairedis
that referenced
this issue
Sep 2, 2021
#878) According to https://github.com/Azure/SONiC/blob/ec6d35dd2c28491bfade19cfee990fe612f1e5e9/doc/rates-and-utilization/Rates_and_utilization_HLD.md, counterpoll command gives polling interval in milliseconds. So when converting them to seconds to be supplied to lua script this should be divide by 1000. However, syncd multiplies it by 1000. Changed the multiplication to none, and did the converting in lua script - sonic-net/sonic-swss#1855 Fixed issue - sonic-net/sonic-buildimage#8392
qiluo-msft
pushed a commit
to sonic-net/sonic-sairedis
that referenced
this issue
Sep 2, 2021
#878) According to https://github.com/Azure/SONiC/blob/ec6d35dd2c28491bfade19cfee990fe612f1e5e9/doc/rates-and-utilization/Rates_and_utilization_HLD.md, counterpoll command gives polling interval in milliseconds. So when converting them to seconds to be supplied to lua script this should be divide by 1000. However, syncd multiplies it by 1000. Changed the multiplication to none, and did the converting in lua script - sonic-net/sonic-swss#1855 Fixed issue - sonic-net/sonic-buildimage#8392
qiluo-msft
pushed a commit
to sonic-net/sonic-swss
that referenced
this issue
Sep 3, 2021
… MS (#1855) **What I did** Update the rif_rates/lua script to multiply by 1000 instead of FlexCounter class. related also to this PR - sonic-net/sonic-sairedis#878 Fix issue - sonic-net/sonic-buildimage#8392 **Why I did it** times were not calculated properly. **How I verified it** check that the output of cli and redis is close enough:
qiluo-msft
pushed a commit
to sonic-net/sonic-swss
that referenced
this issue
Sep 3, 2021
… MS (#1855) **What I did** Update the rif_rates/lua script to multiply by 1000 instead of FlexCounter class. related also to this PR - sonic-net/sonic-sairedis#878 Fix issue - sonic-net/sonic-buildimage#8392 **Why I did it** times were not calculated properly. **How I verified it** check that the output of cli and redis is close enough:
judyjoseph
pushed a commit
to sonic-net/sonic-swss
that referenced
this issue
Sep 14, 2021
… MS (#1855) **What I did** Update the rif_rates/lua script to multiply by 1000 instead of FlexCounter class. related also to this PR - sonic-net/sonic-sairedis#878 Fix issue - sonic-net/sonic-buildimage#8392 **Why I did it** times were not calculated properly. **How I verified it** check that the output of cli and redis is close enough:
judyjoseph
pushed a commit
to sonic-net/sonic-sairedis
that referenced
this issue
Oct 5, 2021
#878) According to https://github.com/Azure/SONiC/blob/ec6d35dd2c28491bfade19cfee990fe612f1e5e9/doc/rates-and-utilization/Rates_and_utilization_HLD.md, counterpoll command gives polling interval in milliseconds. So when converting them to seconds to be supplied to lua script this should be divide by 1000. However, syncd multiplies it by 1000. Changed the multiplication to none, and did the converting in lua script - sonic-net/sonic-swss#1855 Fixed issue - sonic-net/sonic-buildimage#8392
raphaelt-nvidia
pushed a commit
to raphaelt-nvidia/sonic-swss
that referenced
this issue
Oct 5, 2021
… MS (sonic-net#1855) **What I did** Update the rif_rates/lua script to multiply by 1000 instead of FlexCounter class. related also to this PR - sonic-net/sonic-sairedis#878 Fix issue - sonic-net/sonic-buildimage#8392 **Why I did it** times were not calculated properly. **How I verified it** check that the output of cli and redis is close enough:
pettershao-ragilenetworks
pushed a commit
to pettershao-ragilenetworks/sonic-sairedis
that referenced
this issue
Nov 18, 2022
sonic-net#878) According to https://github.com/Azure/SONiC/blob/ec6d35dd2c28491bfade19cfee990fe612f1e5e9/doc/rates-and-utilization/Rates_and_utilization_HLD.md, counterpoll command gives polling interval in milliseconds. So when converting them to seconds to be supplied to lua script this should be divide by 1000. However, syncd multiplies it by 1000. Changed the multiplication to none, and did the converting in lua script - sonic-net/sonic-swss#1855 Fixed issue - sonic-net/sonic-buildimage#8392
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
RIF rates and port rates calculation has couple of issues.
The counterpoll command gives polling interval in milliseconds. Lua script expects the delta (time difference) arguments to be in seconds. However, syncd multiplies it by 1000 which I think is wrong.(Rates would be order of 10^6 less).
https://github.com/Azure/sonic-sairedis/blob/master/syncd/FlexCounter.cpp#L1600
Based on the HLD, the rates are calculated using difference between old counter and new counter values. However according to lua script, the _last counter values become stagnant and never gets updated after the initialization time which again I feel is wrong. Ideally to calculate the rate, we should have counters before the delta and after the delta divided by delta.
https://github.com/Azure/sonic-swss/blob/4f1d726d4cbf8a283b22cd5f612cf03ca21a27b3/orchagent/rif_rates.lua
Steps to reproduce the issue:
Describe the results you received:
I tried to compare CLI vs lua script (CLI with period calculates accurately) with 5000 pps flood ping from a server.
LUA rates
Describe the results you expected:
Rates should be comparable to the rate of packets sent.
Output of
show version
:Output of
show techsupport
:Additional information you deem important (e.g. issue happens only occasionally):
The text was updated successfully, but these errors were encountered: