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

Performance impact because of decoded message struct #266

Open
srikartati opened this issue Oct 22, 2021 · 2 comments
Open

Performance impact because of decoded message struct #266

srikartati opened this issue Oct 22, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@srikartati
Copy link
Contributor

Describe the bug
The message struct contains set pointer. And set pointer contains pointers to records. A single record contains pointers to multiple information elements.

Using pointers in these different levels of methods puts pressure on GC. We need to revisit the decision of using interface to support both template and data entities. This leads to the use of a pointer. Instead, move to the direct structs.
In addition for the decoded messages, allocate contiguous memory and fill the required data in it.

To Reproduce
Memory consumption with antrea and ipfix performance tests. Fragmentation because of GC stress.

Expected behavior
We should cut down the difference between sys and heap usage

Additional context
Try with a PoC and improve upon it.

@srikartati srikartati added the bug Something isn't working label Oct 22, 2021
@srikartati
Copy link
Contributor Author

@zyiou @wsquan171 For closer look.

@srikartati
Copy link
Contributor Author

srikartati commented Jun 11, 2022

Hi @dreamtalen @heanlan
Hope you are doing well. Just wondering about the resolution of this performance issue where high memory is consumed.

One thing I came across is option templates in IPFIX. It is generally used for sending metadata for different info in flow records.
For example, our flow record has complete metadata along with five tuple. However, metadata is sent multiple times unnecessarily. Instead Flow Exporter could send it as a separate record with IP of endpoint and corresponding pod name using an option template.
Using option templates for metadata seems to be industry standard.

https://docs.paloaltonetworks.com/prisma/prisma-sd-wan/prisma-sd-wan-admin/prisma-sd-wan-sites-and-devices/use-external-services-for-monitoring/prisma-sd-wan-ipfix/ipfix-template-record-options

https://kb.vmware.com/s/article/79184

The benefit of doing this is reducing the size of the record that we store in in-memory map at flow aggregator. Smaller record will require smaller allocation of memory leading lower fragmentation. We may need to have multiple maps.

Just wanted to share this for a while. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant