Skip to content

[FEATURE] Investigate GetXAttr performance #971

Closed
@Kern--

Description

Description

Looking at CPU profiles for a couple of containers, it seems that GetXAttr is consistently showing up as a non-trivial amount of the soci-snapshotter's runtime. Specifically it is n.IsOpaque() which checks for the existance of a whiteout in the metadata db:

func (n *node) isOpaque() bool {
if _, _, err := n.fs.r.Metadata().GetChild(n.id, whiteoutOpaqueDir); err == nil {
return true
}
return false
}

example profiles:
cpu_runtime
cpu_runtime

It's possible that this is a red herring and what we're actually seeing is just that GetXAttr is a very common, so we should be careful how much effort we put into this before validating that we're seeing benefit.

Describe the solution you'd like

We should investigate whether there is a way we can reduce the cost of n.IsOpaque().

We could possibly move the opaqueness to a property of the node itself rather than pushing it down into the metadata db. A good first step might be to try this and compare benchmarks to see if it has an effect.

Describe any alternative solutions/features you've considered

No response

Any additional context or information about the feature request

No response

Activity

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

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    • Status

      ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions