[CDRIVER-3514] SCRAM cache should be shared among all pooled clients Created: 02/Feb/20 Updated: 16/Oct/23 Resolved: 12/Oct/23 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | auth, libmongoc, Performance |
| Affects Version/s: | None |
| Fix Version/s: | 1.25.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Kevin Albertson | Assignee: | Kyle Kloberdanz |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Epic Link: | CDRIVER-4575 | ||||
| Quarter: | FY24Q3 | ||||
| Description |
|
The cache for SCRAM credentials is attached to the mongoc_cluster_t object, which manages the connections for a single mongoc_client_t. However, this means that two mongoc_client_t's popped from a mongoc_pool_t have different SCRAM caches. I believe it should instead be moved to the mongoc_topology_t, so client pools can better utilize the cache. |
| Comments |
| Comment by Githook User [ 16/Oct/23 ] |
|
Author: {'name': 'Kyle Kloberdanz', 'email': 'kyle.kloberdanz@mongodb.com', 'username': 'kkloberdanz'}Message: Fix Windows shared mutex unlocking (#1445) Unlike a POSIX read/write lock, in which both a read lock and a write Related: |
| Comment by Githook User [ 12/Oct/23 ] |
|
Author: {'name': 'Kyle Kloberdanz', 'email': 'kyle.kloberdanz@mongodb.com', 'username': 'kkloberdanz'}Message: Share SCRAM cache via a global lookup table (#1406)
--------- Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com> |
| Comment by Josh Siegel (Inactive) [ 11/Aug/23 ] |
|
I was unable to complete this ticket before my internship ended. Here is all of the progress I was able to make with an explanation and my thoughts on the next steps: https://github.com/mongodb/mongo-c-driver/pull/1375 |
| Comment by Josh Siegel (Inactive) [ 08/Aug/23 ] |
|
Here is a simple project to test changes against a local install of the C driver in `mongo-c-driver/.install` (see `configure.sh`): scram-cache-testing.zip The steps to take to generate the FlameGraph are as follows:
mlaunch init \ 2. `./configure.sh`, `./build.sh` 3. `sudo perf record --call-graph fp ./test.sh` 4. `sudo chmod +rx perf.data` 5. `perf script | ./stackcollapse-perf.pl |./flamegraph.pl > perf.svg` You can then download `perf.svg` and open it in a browser to view. I attached what it looks like for me prior to any changes. |
| Comment by Simon Eismann [ 05/Jun/23 ] |
|
This currently causes our performance tests with 10K threads to be bottlenecked on the client side. See PERF-4166 and this Slack thread for details. |