[CDRIVER-4002] Improve multi-threaded perf for mongoc_client_pool_t Created: 19/May/21 Updated: 28/Oct/23 Resolved: 06/Jan/22 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | Performance |
| Affects Version/s: | None |
| Fix Version/s: | 1.20.0 |
| Type: | Epic | Priority: | Critical - P2 |
| Reporter: | Kevin Albertson | Assignee: | Colby Pike |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Start date: | |||||||||
| End date: | |||||||||
| Calendar Time: | 24 weeks, 3 days | ||||||||
| Scope Cost Estimate: | 5 | ||||||||
| Cost to Date: | 11 | ||||||||
| Final Cost Estimate: | 12 | ||||||||
| Cost Threshold %: | 150 | ||||||||
| Detailed Project Statuses: | Engineer(s): Colby, Kevin Summary: Improve multi-threaded perf for mongoc_client_pool_t 2021-12-27: Status update: Updating end date to 1/7/2022
Rationale for delays:
Risks:
2021-12-13: Updating end date to 12/17/2021 Status update:
Rationale for delays:
Risks:
2021-11-30: Updating end date to 12/07/2021 Status update:
Rationale for delays:
Risks:
2021-11-16: Updating end date to 11/19/2021 Status update:
Rationale for delays:
Risks:
2021-11-02: Updated target date to 2021-11-05 Status update:
Rationale for delays:
Risks:
2021-10-19: No update to target date Status update:
Rationale for delays:
Risks:
2021-10-05: Updating target date to 2021-10-22 Status update:
Rationale for delays:
Risks:
2021-09-21: Updating target date to 2021-10-08 Status:
Rationale for delays:
Risks:
2021-09-07: No update to target date.
2021-08-24: Updating target date to 2021-09-24
2021-08-10: Setting initial target end date to 2021-08-27
|
||||||||
| Description |
|
A simple benchmark which spawns shows negative scaling of operation throughput as the thread count increases. workload_find.c creates n threads. Each thread pops a client from a mongoc_client_pool_t and repeatedly executes a find with filter _id: 0. I observed similar scaling behavior. I added a flag to alternatively create a separate single-threaded client per thread. These were the results on a 16 vCPU Ubuntu 18.04 host:
Taking five samples of GDB stack traces shows many threads waiting for the topology mutex:
Some of these functions could optimize to reduce how long they hold the topology mutex. A read/write lock may benefit the functions that are only reading the topology description. To verify the performance is improved, let's add a performance benchmark test to exercise concurrent operations on a mongoc_client_pool_t. |
| Comments |
| Comment by Kevin Albertson [ 17/Nov/21 ] | ||||||||||||
|
C 1.20.0 has been released. Leaving this epic open until continuous tests ( | ||||||||||||
| Comment by Kevin Albertson [ 17/Nov/21 ] | ||||||||||||
|
This is the result of running a slightly modified workload_find.c on an ubuntu1804-large host against 1.19.2 and the current development branch on commit 6f2102b. This includes
This includes scripts to compare against the 1.19.2 release and current development branch: | ||||||||||||
| Comment by Githook User [ 17/Nov/21 ] | ||||||||||||
|
Author: {'name': 'vector-of-bool', 'email': 'vectorofbool@gmail.com', 'username': 'vector-of-bool'}Message:
Tag Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>
This change only applies to private code, and does not expose any
Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com> |