[SERVER-2516] mongostat shows incorrect connections number Created: 10/Feb/11  Updated: 30/Mar/12  Resolved: 10/Feb/11

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

Type: Bug Priority: Minor - P4
Reporter: Brennan Pang Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS 5.2


Operating System: ALL
Participants:

 Description   

Running mongostat with no params locally to connect to localhost shows an incorrect number of connections when compared to running with -h hostname or checking the rest interface.

-bash-3.2$ ./mongostat
connected to: 127.0.0.1
insert/s query/s update/s delete/s getmore/s command/s flushes/s mapped vsize res faults/s locked % idx miss % q t|r|w conn time
0 0 0 0 0 3 0 168095 168385 52 0 0 0 0|0|0 8 16:42:49
0 0 0 0 0 3 0 168095 168385 52 0 0 0 0|0|0 8 16:42:50

-bash-3.2$ ./mongostat -h hostname.com
connected to: sharemdb01c.internal.shutterfly.com
insert/s query/s update/s delete/s getmore/s command/s flushes/s mapped vsize res faults/s locked % idx miss % q t|r|w conn time
0 17 2 0 4 5 0 171038 173876 40354 1 0 0 0|0|0 209 16:46:22
0 31 1 0 2 6 0 171038 173876 40354 0 0 0 0|0|0 209 16:46:23

http://hostname.com:28017/serverStatus?text

"connections" :

{ "current" : 208, "available" : 19792 }

,



 Comments   
Comment by Rostislav Dzinko [ 29/Apr/11 ]

There is one mongo instance running.
I use:
netstat | grep 27017

and see near 50 hanging ('ESTABLISHED') connections.
I actually don't know if to trust netstat in this case but 500 connections seems too unreal for me.

Comment by Eliot Horowitz (Inactive) [ 29/Apr/11 ]

How are you measuring 50?

Comment by Rostislav Dzinko [ 29/Apr/11 ]

This bug also affects me. Mongostat shows 500 open connections, when there are really about 50 of those.

Comment by Brennan Pang [ 10/Feb/11 ]

Yes it did at the time. Oddly enough, I can't seem to reproduce it from the same machine today. It did seem that the behavior of running ./mongostat without -h was connecting to another one of the set members, which is why the stats looked that way. I'll follow up if I encounter the issue again.

Comment by Eliot Horowitz (Inactive) [ 10/Feb/11 ]

Can you verify that hostname.com resolves to the same machine where you did 127.0.0.1?

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