Skip to content

Conversation

li4wang
Copy link
Contributor

@li4wang li4wang commented Jul 21, 2025

Setting the default max queue size to 10k instead of 1M to reduce the memory footprint and optimize GC overhead for enabling Prometheus metrics provider.

The read throughput was increased by 52% according to our internal perf comparison tests.

@li4wang
Copy link
Contributor Author

li4wang commented Aug 25, 2025

@eolivelli Would you mind taking a look at this PR? Thanks.

@li4wang
Copy link
Contributor Author

li4wang commented Aug 28, 2025

@kezhuw would you mind taking a look at it? Thanks.

Copy link
Member

@kezhuw kezhuw left a comment

Choose a reason for hiding this comment

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

Looks good to me. If system is overloading 10000, it will overloading 1000000 finally. Reducing the max queue size will let us know this earlier.

Setting the default max queue size to 10k instead of 1M to reduce the memory footprint and optimize GC overhead for enabling Prometheus metrics provider.

Does ArrayBlockingQueue help ?

@li4wang
Copy link
Contributor Author

li4wang commented Sep 4, 2025

Thanks for reviewing the PR. @kezhuw

The ArrayBlockingQueue uses less bytes per element compared to LinkedBlockingQueue, however it allocates memory for all elements upfront. It could be beneficial if the maxQueueSize is set to some reasonable value.

We can look into the potential enhancement of conditionally use LinkedBlockingQueue vs ArrayBlockingQueue based on some perf test results.

@li4wang li4wang merged commit 7c414c1 into apache:master Sep 4, 2025
16 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