You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Rajee Gupta <ra...@gmail.com> on 2025/08/21 20:15:45 UTC
[Pool] New Feature: Configuration option to toggle statistics collection
Hi Apache Commons Pool community, I hope this email finds you well. I'd
like to take feedback on a performance enhancement for Commons Pool, and if
my understanding is correct.
*Problem Statement*
While analyzing pool performance under high load, I identified that
detailed statistics collection (mean active time, mean idle time, mean
borrow wait time) can become a bottleneck in high-throughput scenarios.
These statistics, while valuable for monitoring, involve timing
calculations and circular buffer operations that add overhead to every
borrow/return operation. For applications that prioritize throughput over
detailed monitoring, there is no way to disable this overhead, and it leads
to useful threads blocked on the synchronized block.
[image: Screenshot 2025-08-22 at 1.40.11 AM.png]
Proposed SolutionImplement a new configuration option
collectDetailedStatistics that allows users to disable detailed
timing statistics collection.
I'm happy to discuss any aspects of this proposal or make adjustments based
on community feedback. Also, I apologize in advance if I've missed any
basic understanding of updateStatsBorrow/Return, and this change would
impact any functional behaviour of the Pool. Any guidance or corrections
would be greatly appreciated. And if this looks fine, I'll go ahead and
raise the PR.
Thanks.
Re: [Pool] New Feature: Configuration option to toggle statistics collection
Posted by Gary Gregory <ga...@gmail.com>.
Hi,
This list doesn't accept attachments. Can you post a link to your image?
TY!
Gary
On Fri, Aug 22, 2025 at 6:12 PM Rajee Gupta <ra...@gmail.com> wrote:
>
> Hi Apache Commons Pool community, I hope this email finds you well. I'd
> like to take feedback on a performance enhancement for Commons Pool, and if
> my understanding is correct.
>
> *Problem Statement*
> While analyzing pool performance under high load, I identified that
> detailed statistics collection (mean active time, mean idle time, mean
> borrow wait time) can become a bottleneck in high-throughput scenarios.
> These statistics, while valuable for monitoring, involve timing
> calculations and circular buffer operations that add overhead to every
> borrow/return operation. For applications that prioritize throughput over
> detailed monitoring, there is no way to disable this overhead, and it leads
> to useful threads blocked on the synchronized block.
>
> [image: Screenshot 2025-08-22 at 1.40.11 AM.png]
> Proposed SolutionImplement a new configuration option
> collectDetailedStatistics that allows users to disable detailed
> timing statistics collection.
>
> I'm happy to discuss any aspects of this proposal or make adjustments
> based on community feedback. Also, I apologize in advance if I've missed
> any basic understanding of updateStatsBorrow/Return, and this change would
> impact any functional behaviour of the Pool. Any guidance or corrections
> would be greatly appreciated. And if this looks fine, I'll go ahead and
> raise the PR.
>
> Thanks.
>