Skip to content

feat(plugins/container): cache resolution results#1178

Merged
poiana merged 1 commit intofalcosecurity:mainfrom
therealbobo:container-perf
Jan 28, 2026
Merged

feat(plugins/container): cache resolution results#1178
poiana merged 1 commit intofalcosecurity:mainfrom
therealbobo:container-perf

Conversation

@therealbobo
Copy link
Contributor

@therealbobo therealbobo commented Jan 27, 2026

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area plugins

/area registry

/area build

/area documentation

What this PR does / why we need it:

Adds an LRU cache to the container matcher to cache cgroup-to-container resolution results, reducing repeated lookups and improving performance.

The match_cgroup method iterates through all configured container engines (Docker, Podman, CRI, Containerd, etc.) to resolve a cgroup path to a container ID. The same cgroup paths can be resolved repeatedly, causing unnecessary work.

Which issue(s) this PR fixes:

Fixes #1179

Special notes for your reviewer:

@poiana poiana added the size/XL label Jan 27, 2026
@therealbobo therealbobo force-pushed the container-perf branch 3 times, most recently from f4ee1dc to 2ba9c5c Compare January 27, 2026 14:13
@irozzo-1A irozzo-1A changed the title feat(container): cache resolution results feat(plugins/container): cache resolution results Jan 27, 2026
Copy link
Contributor

@irozzo-1A irozzo-1A left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot for this! You just forgot adding the LRU test to CMake

@irozzo-1A
Copy link
Contributor

irozzo-1A commented Jan 27, 2026

This should fix the failing CI job

@irozzo-1A
Copy link
Contributor

irozzo-1A commented Jan 27, 2026

@therealbobo #1180 entered, after rebasing you should not have the CI failure any longer. Thanks!

Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
@github-actions
Copy link

Rules files suggestions

Copy link
Contributor

@ekoops ekoops left a comment

Choose a reason for hiding this comment

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

Top! Thank you!
/approve

@poiana
Copy link
Contributor

poiana commented Jan 28, 2026

LGTM label has been added.

DetailsGit tree hash: 8be07832ad58b7098255b1272aded96e10bbe8ab

@poiana
Copy link
Contributor

poiana commented Jan 28, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ekoops, therealbobo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit bff3406 into falcosecurity:main Jan 28, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(plugins/container): cpu hotspot in cgroup path to container ID resolution

4 participants

Comments