[DOCS-14152] Investigate changes in SERVER-53639: Add MongoS server status metrics to track how often a cursor has more than 1 batch Created: 22/Jan/21  Updated: 13/Nov/23  Resolved: 23/Mar/21

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.9.0-alpha3, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Jason Price
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-53639 Add MongoS server status metrics to t... Closed
Participants:
Days since reply: 2 years, 46 weeks, 2 days ago
Epic Link: DOCSP-9747
Story Points: 2

 Description   

Description

Downstream Change Summary

Added two server status metrics for MongoS - "mongos.cursor.totalOpened" and "mongos.cursor.moreThanOneBatch". The former documents the total number of cursors that have been opened from the time the MongoS was launched until the time the stat was requested.
The second stat counts the number of MongoS cursors that have performed a getMore. (This is between the shell and the MongoS.)

Description of Linked Ticket

MongoS starts off by issuing a query of batch size 0. Thus, cursors by MongoS will always call a getMore, and therefore, the server status metric which tracks how many cursors return more than one batch will have an artificially inflated value.

The solution - we will be counting the number of cursors that call getMore on MongoS. Thus we will know when to ignore the artificially inflated value.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 22/Mar/21 ]

Author:

{'name': 'Jason Price', 'email': 'jason.price@mongodb.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14152 Add server status cursor has more than one batch
Branch: v5.0
https://github.com/mongodb/docs/commit/a31c154903bb144238c13708fe239f70f2115deb

Comment by Jason Price [ 16/Mar/21 ]

Truncated output from db.serverStatus():

MongoDB Enterprise tic:PRIMARY> db.serverStatus()
{
   "host" : "Jasons-MBP:27001",
   "version" : "4.9.0-alpha2-65-g5285621",
   "process" : "mongod",
   ...
 
   "metrics" : {
 
   ...
	"cursor" : {
			"moreThanOneBatch" : NumberLong(1040),
			"timedOut" : NumberLong(0),
			"totalOpened" : NumberLong(1042),
			"lifespan" : {
				"greaterThanOrEqual10Minutes" : NumberLong(0),
				"lessThan10Minutes" : NumberLong(0),
				"lessThan15Seconds" : NumberLong(2),
				"lessThan1Minute" : NumberLong(0),
				"lessThan1Second" : NumberLong(1038),
				"lessThan30Seconds" : NumberLong(0),
				"lessThan5Seconds" : NumberLong(0)
			},
			"open" : {
				"noTimeout" : NumberLong(0),
				"pinned" : NumberLong(2),
				"total" : NumberLong(2)
			}
		},
 
 
 
	"mongos" : {
			"cursor" : {
				"moreThanOneBatch" : NumberLong(0),
				"totalOpened" : NumberLong(0)
			}
		},
...
}

The first set of moreThanOneBatch and totalOpened values are already documented as part of https://jira.mongodb.org/browse/DOCS-14139. However, the other two in the new "mongos" section must be documented.

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