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

UDP-receiver improve high-scale performance by skipping usage of decoder when nop encoding is defined #28899

Closed
hovavza opened this issue Nov 6, 2023 · 4 comments

Comments

@hovavza
Copy link
Contributor

hovavza commented Nov 6, 2023

Component(s)

pkg/stanza, receiver/udplog

Is your feature request related to a problem? Please describe.

Udp receiver needs to to be maximally optimized since in high-scale scenarios, it's very easy to lose data.
Specifically, udp-receiver calls the decoder even when nop encoding is defined. That is unnecessary, since all the decoder does is copy the byte array to a new byte array (see here: https://cs.opensource.google/go/x/text/+/refs/tags/v0.14.0:transform/transform.go;l=313). The udp-receiver immediately converts that byte array to a string anyway.

Describe the solution you'd like

In handleMessage, in nop encoding is configured, don't run the decode method.
This saves a memory allocation for each packet. In high scale scenarios, it can mean hundred of thousands less allocation per second, which reduces load on the GC, and reduces memory usage.

Describe alternatives you've considered

None. This is a very specific suggestion.

Additional context

No response

@hovavza hovavza added enhancement New feature or request needs triage New item requiring triage labels Nov 6, 2023
Copy link
Contributor

github-actions bot commented Nov 6, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@djaglowski
Copy link
Member

Thanks for the issue @hovavza. Seems reasonable to me.

@djaglowski djaglowski removed the needs triage New item requiring triage label Nov 14, 2023
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jan 15, 2024
@djaglowski
Copy link
Member

Closed by #28901

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

2 participants