Querying connection information in MongoDB
As with all other database platforms, daily administration and troubleshooting of MongoDB often begins with analyzing database activity. It can be helpful to see all connections from within MongoDB, which you can do by running:
where the “true” makes the command include idle connections. But often there's so many connections that unless you capture the output in a script file or some similar thing, it's kind of useless.
Thanks to a hint given by Scott Hernandez in the mongodb-user forum, we can use the line
to show a subset that is more manageable. For instance, we might want to show all connections from a particular application server:
or from the MongoDB logs we’ll see a particular connectionId and want to know where it came from:
This will then show all the connection info for that connectionId:
Archives
- May 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- November 2009
- March 2008
- November 2007
- October 2007


Comments
Reply