[CDRIVER-3429] Turn off libmongoc shared memory counters by default? Created: 11/Nov/19  Updated: 05/Feb/24

Status: Backlog
Project: C Driver
Component/s: cmake, libmongoc, Performance
Affects Version/s: None
Fix Version/s: 2.0.0

Type: Improvement Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-3234 ENABLE_SHM_COUNTERS, ENABLE_SRV, and ... Closed
Epic Link: CDRIVER-4577

 Description   

By default, if shared memory is supported, libmongoc gathers statistics about client/cursor/socket usage. See the Basic Troubleshooting page for more info.

They are currently enabled by default on Linux if shared memory is supported. They may be opted-out at configuration time with -DENABLE_SHM_COUNTERS=OFF or at runtime with the MONGOC_DISABLE_SHM.

The shared memory segment is unlinked in mongoc_cleanup, but if a user does not call that function, or a crash occurs before that function is called, then this may result in shared memory segments being left around.

Let's consider whether this should be an opt-in feature rather than opt-out. This would be a bit of a behavior change, but it's not clear to me how disruptive changing this default would be.



 Comments   
Comment by Kevin Albertson [ 06/Jan/20 ]

In CDRIVER-3234, we may change how we detect if shared memory support is available.

Comment by Roberto Sanchez [ 02/Dec/19 ]

kevin.albertson I see no reason why it would be disruptive. The only wrinkle that would affect packaging would be if this change resulted in a SONAME bump. That seems unlikely to be the case.

Comment by Kevin Albertson [ 02/Dec/19 ]

roberto.sanchez from a packaging perspective, do you think disabling shared memory counters by default would be disruptive?

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