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

Agent performance improvements #2170

Open
6 of 16 tasks
krdln opened this issue Jun 20, 2023 · 0 comments
Open
6 of 16 tasks

Agent performance improvements #2170

krdln opened this issue Jun 20, 2023 · 0 comments

Comments

@krdln
Copy link
Contributor

krdln commented Jun 20, 2023

Tackle low-hanging fruits in terms of agent performance improvements and remove major bottlenecks. Also try to reduce GC pressure.

image

The largest CPU utilization (10%) is RequestToInputWithServices which is creating the input for Rego. We can avoid this for flows that don't have any matching classifiers by running selector matching stage before creating this input.
Classify function that invokes Rego is 6.5%
CheckRequest is 3.6%
Log processing is 10%
Batch processor (for sending cloud metrics) is 5%
Grpc stream handling is 13%
go runtime schedule is 10
gc is about 10%

In italics are marked things that require some bigger changes

@krdln krdln self-assigned this Jun 20, 2023
krdln added a commit that referenced this issue Jun 21, 2023
We never mutate entities directly in the maps, so copying was not necessary.
Also, added added a type wrapper so it's less likely someone tries mutating the
returned entity.

Drive-by:
* Stop using proto-generated structs for Entities datastructure.
* Fix lock in Clear() (fortunately, used only in tests).

Part of #2170
@krdln krdln removed their assignment Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant