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

Statd: improve speed of interface data #651

Merged
merged 4 commits into from
Sep 25, 2024

Conversation

rical
Copy link
Contributor

@rical rical commented Sep 25, 2024

Description

This PR removes the statd interface netlink code and improve speed of operational interface data.

This is a major redesign of statd interface handling. The goal here is to reduce the time it takes for statd to produce operational data for all interfaces on larger iron. Which manifested itself most notably in the CLI command "show interfaces".

This PR removes the netlink interface subscriptions done by the statd c code. Instead statd now subscribes to the ietf-interfaces base path which means it will be invoked for all interfaces. If the user (sysrepo) has specified an explicit interface name such as eth0, it will be extracted by statd and passed down to Yanger.

This PR also modifies Yanger to fit this new modus. No explicitly passed interface name now means all interfaces.

Side note

The main culprit of the slow operational interface data is the time it takes to bootstrap python. Which prior to this PR was done for each interface. On the HW system I'm testing this PR on, runtime is reduced by a factor of 10.

This is a major redesign of statd interface handling. The goal here is
to reduce the time it takes for statd to produce operational data for
all interfaces on larger iron. Which manifested itself most notably in
the CLI command "show interfaces".

This patch removes the netlink interface subscriptions done by the
statd c code. Instead statd now subscribes to the ietf-interfaces
base path which means it will be invoked for all interfaces.
If the user (sysrepo) has specified an explicit interface name such as
eth0, it will be extracted by statd and passed down to Yanger.

This patch also modifies Yanger to fit this new modus. No explicitly
passed interface name now means all interfaces.

Side note:
The main culprit of the slow operational interface data is the time it
takes to bootstrap python. Which prior to this patch was done for each
interface. On the HW system I'm testing this patch on, runtime is
reduced by a factor of 10.

Signed-off-by: Richard Alpe <richard@bit42.se>
A non functional change. The caller knows more about how to format the
args, so it makes more sense to build the Yanger cmdline from the
caller.

Signed-off-by: Richard Alpe <richard@bit42.se>
Debug print the full xpath in all callbacks.

Signed-off-by: Richard Alpe <richard@bit42.se>
This is basically a functionally revert of:
435c5ca statd: allow ethtool --json to fail without breaking operational ds

Having a fail flag that hides all yanger faults is too big of a
hammer. If some hardware doesn't support a particular command such as
"ethtool --json" it should be handled gracefully by yanger. Perhaps by
catching the error and returning an empty dataset for that node.

Signed-off-by: Richard Alpe <richard@bit42.se>
Copy link
Contributor

@troglobit troglobit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work on this! 🔥 🥂

Must say I also, very much, appreciate the detailed analysis in the report and summary of changes here in the PR. 🥇

@troglobit troglobit merged commit e373398 into kernelkit:main Sep 25, 2024
4 checks passed
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.

2 participants