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

use recycler for packetbatch allocation #4381

Conversation

lijunwangs
Copy link

Problem

It is found that the packet coalescer packet_batch_sender in quic streamer is lagging behind the streamer's ingestion of packets under load testing. And one of the costly operations are malloc for new PacketBatch.

Summary of Changes

Use PacketBatchRecycler to reduce the malloc cost.

Fixes #

use recycler for packetbatch allocation
@lijunwangs
Copy link
Author

CPU usage for the coalescer without the recycler:

Screenshot 2025-01-09 at 4 10 31 PM

With the recycler:

Screenshot 2025-01-09 at 4 59 16 PM

Copy link

@behzadnouri behzadnouri left a comment

Choose a reason for hiding this comment

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

lgtm, but I would suggest to also confirm that the runtime performance improves in terms of some timing, throughput or latency metrics, etc. (perf profiles can sometimes be misleading and inconsistent with metrics).

@lijunwangs
Copy link
Author

In my test configurations using bench-vote tool, with everything else equal, with two sender clients:

I got the following sustained rates from the sink: (reported every 5 s)

With fix:
Received txns count: 2740424

Vs without:

Received txns count: 1402725

@lijunwangs lijunwangs merged commit 9624dad into anza-xyz:master Jan 10, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants