-
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
[Celestica] Make 'sfputil show presence' 10x faster #18041
base: master
Are you sure you want to change the base?
Conversation
The is_host function is used when enumerating SFPs which was very slow when detecting if it was running inside docker. The following call makes the detection 10x faster. Before patch: $ time sudo sfputil show presence Port Presence ----------- ----------- Ethernet0 Present Ethernet1 Present Ethernet2 Present -- snip -- real 0m13.521s user 0m10.239s sys 0m4.104s After patch: $ time sudo sfputil show presence Port Presence ----------- ----------- Ethernet0 Present Ethernet1 Present Ethernet2 Present -- snip -- real 0m2.133s user 0m1.461s sys 0m0.347s Signed-off-by: Tommy Nevtelen <tommy@nevtelen.com>
|
@lguohan Is there still something needed before this can be reviewed? |
Ping @lguohan - would be nice to get into the 202411 release if possible. |
Ping @lguohan - one last attempt before the 202411 release fork happens! |
The only thing I can think of why they haven't merged this is maybe they don't like this change in how the check works for fear issues without Celestica's approval? Technically the more proper thing to do is look at Perhaps more acceptable would be to cache the result instead inside of |
Why I did it
The is_host function is used when enumerating SFPs which was very slow when detecting if it was running inside docker. The following call makes the detection 10x faster.
How I did it
Instead of executing
docker
check for/.dockerenv
which is present when inside a container.How to verify it
Before patch:
After patch:
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
n/a
Link to config_db schema for YANG module changes
n/a
A picture of a cute animal (not mandatory but encouraged)