[SERVER-14321] Need to get the server name from which the connections are coming to Mongo Created: 20/Jun/14  Updated: 16/Mar/16  Resolved: 20/Jun/14

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

Type: Improvement Priority: Trivial - P5
Reporter: Srivatsa N Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Currently db.serverStatus().connections provides the number of connections that are coming to Mongo but there is no way we can determine from where they are coming. For Example,

> db.serverStatus().connections

{ "current" : 2, "available" : 202, "totalCreated" : NumberLong(2) }

>

Currently, there are two connections but I cant determine from where they are coming. It would be great if there is an enhancement on this part.



 Comments   
Comment by Scott Hernandez (Inactive) [ 20/Jun/14 ]

You can get all the client connection information from the expanded current operation information:

>db.currentOp(true)
...		{
			"opid" : 148754,
			"active" : false,
			"op" : "insert",
			"ns" : "",
			"insert" : {
				
			},
			"client" : "127.0.0.1:52445",
			"desc" : "conn28",
			"threadId" : "0x112fab000",
			"connectionId" : 28,
			"locks" : {
				"^test" : "W"
			},
			"waitingForLock" : true,
			"numYields" : 0,
			"lockStats" : {
				"timeLockedMicros" : {
					
				},
				"timeAcquiringMicros" : {
					
				}
			}
...

Each entry with a client address and description of connXXXX is a client connection.

It is best to ask questions like this on the forum (https://groups.google.com/forum/#!forum/mongodb-user) instead of filing issues in the server project first.

Generated at Thu Feb 08 03:34:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.