[SERVER-34422] Expose metrics on idle versus active client threads Created: 11/Apr/18  Updated: 08/Jan/24  Resolved: 28/Jan/19

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: None
Fix Version/s: 4.0.7, 4.1.8

Type: New Feature Priority: Major - P3
Reporter: Mira Carey Assignee: Tyler Kaye
Resolution: Fixed Votes: 2
Labels: SWDI, gm-ack, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Documented
is documented by DOCS-12400 Docs for SERVER-34422: Expose metrics... Closed
Related
is related to SERVER-38104 serverStatus metrics for currently in... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Service Arch 2018-10-08, Service Arch 2018-11-05, Service Arch 2018-11-19, Service Arch 2018-12-03, Service Arch 2018-12-17
Participants:
Case:

 Description   

Exposing metrics in mongodb processes on whether client driven threads were active or idle would provide better insight into the overall utilization of the system and the disposition of client threads.

One data point might come from incrementing a counter on client creation, then decrementing on entry to the MONGO_IDLE_THREAD_BLOCK (used internally to hide uninteresting callstacks for debugging). Another might only increment and decrement around top level calls to recv (to indicate threads engaged in client work, idle or not)



 Comments   
Comment by Githook User [ 12/Mar/19 ]

Author:

{'name': 'Tyler Kaye', 'username': 'tkaye407', 'email': 'tyler.kaye@mongodb.com'}

Message: SERVER-34422-ThreadMetrics: ServerStatus now returns the number of active client operations

(cherry picked from commit cdf319123d8e5d3cd169e2a11aec6aea0b951bf1)
Branch: v4.0
https://github.com/mongodb/mongo/commit/701cf71ba3e8ffa706bfb49d3ea2d44dc1654126

Comment by Githook User [ 28/Jan/19 ]

Author:

{'username': 'tkaye407', 'email': 'tyler.kaye@mongodb.com', 'name': 'Tyler Kaye'}

Message: SERVER-34422-ThreadMetrics: ServerStatus now returns the number of active client operations
Branch: master
https://github.com/mongodb/mongo/commit/cdf319123d8e5d3cd169e2a11aec6aea0b951bf1

Comment by Mira Carey [ 19/Oct/18 ]

The measurement around MONGO_IDLE_THREAD_BLOCK would offer the number of threads doing work at that instant. I.e. not threads blocked in sleep, or waiting on write concern. This would allow us to differentiate workloads with high thread counts, but low activity, from those that are contending harder.

The second measurement (up by recving new client requests and creating opctx's), would be exactly the number of live ops on a mongos.

I wanted a more general ticket because I'm interested in a few different slices of idleness and wanted a chance to take some extra measurements if we're already in there

Comment by Bruce Lucas (Inactive) [ 12/Apr/18 ]

The scenario that prompted this was a need for measuring number of current active operations in mongos. That requirement could be satisfied by maintaining a counter higher up in the stack, I believe. Would this counter normally track the more-or-less the same number? How would it differ?

Generated at Thu Feb 08 04:36:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.