[CDRIVER-4663] Eagerly create minPoolSize connections Created: 15/Jun/23  Updated: 23/Jan/24

Status: In Code Review
Project: C Driver
Component/s: Performance
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Ryan Timmons Assignee: Kyle Kloberdanz
Resolution: Unresolved Votes: 1
Labels: perf-pain
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File main.c    
Issue Links:
Problem/Incident
Related
is related to CXX-1808 Documentation and examples should not... Backlog
is related to CDRIVER-2389 Deprecate minPoolSize and log a warni... Closed
Quarter: FY24Q4

 Description   

The C/C++ driver's connection pool does not eagerly create connections even when the minPoolSize config is set. This is surprising behavior and has lead to difficult-to-diagnose performance issues when the first operation has wildly different performance from subsequent operations.

What's more is that the driver spec seems to require this behavior:

If minPoolSize is set, the Connection Pool MUST be populated until it has at least minPoolSize total Connections.



 Comments   
Comment by James Littlejohn [ 10/Jan/24 ]

ryan.timmons@mongodb.com Yeah, minh.luu@mongodb.com landed our version of pre-warm (which is pinging the admin database too) very recently in https://github.com/mongodb/genny/pull/970 through DEVPROD-2090. We mostly got blocked up on the performance implications of it (for other readers, Genny can't suddenly increase in performance).

It'd be nice if the C Driver had an option to do this itself, but if it were non-configurable it'd cause some issues (solvable with work) for us.

Comment by Ryan Timmons [ 09/Jan/24 ]

Hey james.littlejohn@mongodb.com, do you think the client_pool_warmup code that kyle.kloberdanz@mongodb.com has above would work for Genny? I think we recently did some work to pre-warm connections in Genny, so I'm curious if there's any overlap?

Comment by Kevin Albertson [ 07/Nov/23 ]

See this comment in CDRIVER-2389 for rationale of why the existing minPoolSize option is deprecated.

I expect another non-deprecated option may need to be added to support this use-case.

Comment by Ger Hartnett [ 04/Jul/23 ]

Changed to a bug because it doesn't follow the driver spec.

Comment by Ger Hartnett [ 16/Jun/23 ]

Adding a link to PERF-4166

Generated at Wed Feb 07 21:21:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.