[JAVA-424] Allow pool to shrink Created: 26/Aug/11  Updated: 03/Apr/14  Resolved: 26/Nov/13

Status: Closed
Project: Java Driver
Component/s: Connection Management
Affects Version/s: None
Fix Version/s: 2.12.0, 3.0.0

Type: New Feature Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Jeffrey Yemin
Resolution: Done Votes: 5
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by JAVA-423 Add ability to specify min pool size Closed
Related
is related to JAVA-710 Support max connection idle time and ... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
JAVA-1008 3.0: Allow pool to shrink Sub-task Closed Jeffrey Yemin  
JAVA-1009 2.12: Allow pool to shrink Sub-task Closed Jeffrey Yemin  

 Description   

Add support for checking on unused resources in the pool so it can shrink over time (to the min pool size).

This will work in conjunction with JAVA-710: support max connection idle time and connection life time.

The connection pool will, at a configurable interval:

  1. prune all connections that exceed either the max idle or max life time
  2. ensure a minimum pool size

By default:

  • min size == 0
  • interval == 1 minute

The minimum size is configuration using the method com.mongodb.MongoClientOptions.Builder#minConnectionsPerHost and the minPoolSize query parameter on the Mongo URI. The interval is not currently configurable.



 Comments   
Comment by Jeffrey Yemin [ 27/Feb/14 ]

Hi there,

Interested parties can test the fix with 2.12.0-rc0, available either on github or Maven Central. Any takers?

Thanks,
Jeff

Comment by Scott Hernandez (Inactive) [ 14/Sep/11 ]

It would be good to implement a minSize and minToKeep options as well to control this. minSize will be the number allocated when the pool is created and minToKeep will be the low water mark on contraction.

Generated at Thu Feb 08 08:52:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.