<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:33:09 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-33363] Getting list of connections per database</title>
                <link>https://jira.mongodb.org/browse/SERVER-33363</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Wondering if there is a way to get a list of connections on a per database basis.  I&apos;ve looked into using db.currentOp(true).inprog which list several connections, but does not show which database it is associated with (see below for example).&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                &quot;desc&quot; : &quot;conn2&quot;,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                &quot;threadId&quot; : &quot;140536019457792&quot;,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                &quot;connectionId&quot; : 2,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                &quot;client&quot; : &quot;172.17.0.1:38292&quot;,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                &quot;active&quot; : false&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        },&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;


&lt;p&gt;It would be great to have the database name associated with it (as long as that connection did a &apos;use&apos; or similar command to connect to it).&lt;/p&gt;

&lt;p&gt;An even better option would be to list databases (as long as they have live connections) and have the connections listed under their individual names.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment></environment>
        <key id="498984">SERVER-33363</key>
            <summary>Getting list of connections per database</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="ben.caimano@mongodb.com">Benjamin Caimano</assignee>
                                    <reporter username="bhairav">Bhairav</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Feb 2018 07:12:24 +0000</created>
                <updated>Wed, 16 Oct 2019 20:58:31 +0000</updated>
                            <resolved>Wed, 16 Oct 2019 20:58:31 +0000</resolved>
                                    <version>3.6.0</version>
                                                    <component>Networking</component>
                                        <votes>0</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="2485741" author="ben.caimano" created="Wed, 16 Oct 2019 20:58:31 +0000"  >&lt;p&gt;Hey &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bhairav&quot; class=&quot;user-hover&quot; rel=&quot;bhairav&quot;&gt;bhairav&lt;/a&gt;, it seems that this ticket became untracked when we had a restructuring of teams. Apologies, this is far from ideal.&lt;/p&gt;

&lt;p&gt;As of v4.0, you can set appName as part of your connection string (see &lt;a href=&quot;https://docs.mongodb.com/manual/reference/connection-string/#urioption.appName&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;). This would likely require you to make your own &lt;a href=&quot;https://docs.mongodb.com/manual/reference/method/Mongo/#Mongo&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Mongo() client connections&lt;/a&gt; or to run one shell process per test suite. The other two options that &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=matt.lord&quot; class=&quot;user-hover&quot; rel=&quot;matt.lord&quot;&gt;matt.lord&lt;/a&gt; had mentioned are probably outside your control. For example, &quot;client&quot; would require one instance per test or egress redirection, this is non-trivial.&lt;/p&gt;

&lt;p&gt;That said, we cannot feasibly annotate currentOp() with database info. I am closing this ticket as &quot;Won&apos;t Fix&quot;.&lt;/p&gt;</comment>
                            <comment id="2025980" author="bhairav" created="Sun, 7 Oct 2018 15:29:56 +0000"  >&lt;p&gt;Thanks Matt.&lt;/p&gt;

&lt;p&gt;I can try out the options you suggested.&#160;&#160; One question though: are the appName and clientMetadata.application.name configurations that can be set in the client connection that is made to the server?&#160; In my case, the user, role, application and host are all the same, but if I can set the appName/clientMetadata then I could fake out some unique names that I can use to track on the server side.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="2018632" author="matt.lord" created="Sun, 30 Sep 2018 18:59:12 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bhairav&quot; class=&quot;user-hover&quot; rel=&quot;bhairav&quot;&gt;bhairav&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;I apologize for the delay. The issue on our side is that a connection on the server side isn&apos;t associated with a database/namespace, as that&apos;s set per operation.&#160;&lt;/p&gt;

&lt;p&gt;I wonder if the client metadata in 3.6+ could serve the same underlying purpose even better? With that you could see connection counts by:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;client&lt;/li&gt;
	&lt;li&gt;appName&lt;/li&gt;
	&lt;li&gt;clientMetadata.application.name&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So you have information to gauge resource usage by user, role, application, and host. With this in mind, does a count by the last used database/namespace still hold special value?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                            <comment id="1844325" author="bhairav" created="Sat, 24 Mar 2018 21:32:20 +0000"  >&lt;p&gt;Thanks Matt.  Appreciate you looking into this.&lt;/p&gt;

&lt;p&gt;My use case is that for every instance of tests I run, I have to create a separate database for them.  These simply do insertion of data only.  Within these, there may be hundreds of connections per DB.  Sometimes, these connections would go away perhaps when a problem happens in environment that kills the connections (temporary network outages or the tests themselves failing).&lt;/p&gt;

&lt;p&gt;By getting a list (or rather number) of connections to the particular database, the reporting side (which only does the read of the data, and has no view into the insertion processes) could watch for these connections to ascertain whether something has gone wrong or not.&lt;/p&gt;

&lt;p&gt;I thought of using some kind of keep-alive mechanism that periodically would update a timestamp which the reporting could interpret.  However, I thought that since MongoDB already showed total connections, it might be easy for it to provide the specific number of connection per DB.  Hence, the ask.&lt;/p&gt;

&lt;p&gt;Hope that helps.&lt;/p&gt;</comment>
                            <comment id="1838877" author="matt.lord" created="Mon, 19 Mar 2018 20:30:50 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bhairav&quot; class=&quot;user-hover&quot; rel=&quot;bhairav&quot;&gt;bhairav&lt;/a&gt;! &lt;/p&gt;

&lt;p&gt;Could you comment on the use case(s) or user story here, taking a step back from any potential implementation? What&apos;s the business problem you want to solve? For example: &quot;As a DBA, I need to better understand how each schema and its users are impacting the current global maximum connection limit&quot;. &lt;/p&gt;

&lt;p&gt;A database in MongoDB is really just a schema or a namespace. So a connection isn&apos;t tightly coupled with it and the current/default namespace is easily crossed (e.g. the db.currentOp() actually executes in the admin database/namespace).&lt;/p&gt;

&lt;p&gt;I would like to better understand what it is that you hope to do with or glean from this information. That would better help me understand what may be the best way to meet your actual use case and business needs. &lt;/p&gt;

&lt;p&gt;Thank you for your interest in MongoDB! &lt;/p&gt;

&lt;p&gt;Best Regards,&lt;/p&gt;

&lt;p&gt;Matt&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 16 Feb 2018 14:32:41 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 17 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ben.caimano@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 17 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>ben.caimano@mongodb.com</customfieldvalue>
            <customfieldvalue>bhairav</customfieldvalue>
            <customfieldvalue>matt.lord</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htqko7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htyznj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htq6tr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>