<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:47:38 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-18425] High Memory usage on Primary and secondary</title>
                <link>https://jira.mongodb.org/browse/SERVER-18425</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We have upgraded to version 3.0.2 and experiencing very bad performance&lt;/p&gt;

&lt;p&gt;We are running replica set and the primary and one secondary is running at 90% Memory which is causing slow performance with our web application &lt;/p&gt;

&lt;p&gt;We have even created a new large box (replica secondary) within AWS and it is running at 90% memory&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;  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                            &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;25036 root      20   0  131g  13g  11g S  2.7 90.7 108:21.05 mongod  &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;When we restart the mongo process on the primary and trigger a failover to another secondary, performance improves. However, after a few hours the memory starts to rise and performance decreases.&lt;/p&gt;

&lt;p&gt;We are currently needing restart the mongod service on our preferred primary every 24 hours to maintain performance.&lt;/p&gt;</description>
                <environment></environment>
        <key id="203468">SERVER-18425</key>
            <summary>High Memory usage on Primary and secondary</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="9">Done</resolution>
                                        <assignee username="sam.kleinman">Sam Kleinman</assignee>
                                    <reporter username="andy@ditno.com">Andy Walker</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 May 2015 00:00:40 +0000</created>
                <updated>Sun, 16 Jul 2017 03:17:27 +0000</updated>
                            <resolved>Thu, 14 May 2015 18:05:33 +0000</resolved>
                                    <version>3.0.2</version>
                                                    <component>Performance</component>
                                        <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="914853" author="andy@ditno.com" created="Fri, 15 May 2015 02:57:53 +0000"  >&lt;p&gt;Thanks Sam&lt;/p&gt;</comment>
                            <comment id="914247" author="samk" created="Thu, 14 May 2015 16:50:15 +0000"  >&lt;p&gt;From the output of &lt;tt&gt;currentOp&lt;/tt&gt;, it looks like you have a large number of long running aggregation operations that may be consuming a large amount of resources, which could affect performance as you observe. &lt;/p&gt;

&lt;p&gt;If you don&apos;t have an appropriate index, this could explain the long running aggregation operations. Adding an index on this field might help these operations complete more quickly. &lt;/p&gt;

&lt;p&gt;Also, it might be worth while to audit your application to make sure that you&apos;re not accidentally creating extra requests. You can also add, the &lt;tt&gt;maxTimeMS&lt;/tt&gt; option to the aggregation command to ensure that operations abort on the server so that the server doesn&apos;t continue to use resources for requests that the client may not handle. &lt;/p&gt;

&lt;p&gt;I&apos;m going to go ahead and close this ticket: the SERVER project is for bugs and feature requests against the MongoDB server, and it doesn&apos;t look like there&apos;s an underlying server issue here. If you encounter a bug in MongoDB, feel free to open another ticket, or or MongoDB-related support discussion please post on the &lt;a href=&quot;http://groups.google.com/group/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-users group&lt;/a&gt;&lt;br/&gt;
or &lt;a href=&quot;http://stackoverflow.com/questions/tagged/mongodb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Stack Overflow with the &lt;tt&gt;mongodb&lt;/tt&gt; tag&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
sam&lt;/p&gt;</comment>
                            <comment id="913676" author="andy@ditno.com" created="Thu, 14 May 2015 02:21:44 +0000"  >&lt;p&gt;Hi Sam&lt;/p&gt;

&lt;p&gt;Please find the requested information below:&lt;/p&gt;

&lt;p&gt;We do not use noTimeout option with cursors.&lt;/p&gt;

&lt;p&gt;ditno_replicaset:PRIMARY&amp;gt; db.serverStatus().metrics.cursor&lt;br/&gt;
{&lt;br/&gt;
	&quot;timedOut&quot; : NumberLong(132),&lt;br/&gt;
	&quot;open&quot; : &lt;/p&gt;
{
		&quot;noTimeout&quot; : NumberLong(0),
		&quot;pinned&quot; : NumberLong(240),
		&quot;total&quot; : NumberLong(242)
	}
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;db.currentOp is attached&lt;/p&gt;

&lt;p&gt;Node &quot;mongodb&quot;: &quot;1.4.29&quot;&lt;br/&gt;
pymongo 2.8&lt;/p&gt;
</comment>
                            <comment id="913675" author="andy@ditno.com" created="Thu, 14 May 2015 02:21:37 +0000"  >&lt;p&gt;db.currentOp output&lt;/p&gt;</comment>
                            <comment id="913263" author="samk" created="Wed, 13 May 2015 20:02:05 +0000"  >&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;This sounds like it could be related to an accumulation of open and potentially unused cursors that are continuing to consume resources but are not being used. To help us narrow down the causes of this issue, could you provide the answer to the following questions:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Do you use the the &lt;tt&gt;noTimeout&lt;/tt&gt; option with cursors? &lt;a href=&quot;http://docs.mongodb.org/manual/core/cursors/#closure-of-inactive-cursors&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Can you provide the output of the &lt;tt&gt;db.serverStatus().metrics.cursor&lt;/tt&gt; operation in the &lt;tt&gt;mongo&lt;/tt&gt; shell connected to a &lt;tt&gt;mongod&lt;/tt&gt; instance that&apos;s experiencing the high memory usage?&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Can you provide the output of &lt;tt&gt;db.currentOp();&lt;/tt&gt; during a period of high memory usage?&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Which client driver(s) and version(s) are your application(s) using?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;It&apos;s also true that MongoDB with the MMAP storage engine, will eventually use all of the memory on a system for cache, but this is mostly an artifact of system memory reporting, and itself doesn&apos;t cause performance issues, consider this &lt;a href=&quot;http://docs.mongodb.org/manual/faq/fundamentals/#does-mongodb-require-a-lot-of-ram&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
sam&lt;/p&gt;</comment>
                    </comments>
                    <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>Wed, 13 May 2015 20:02:05 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 39 weeks, 6 days 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>andy@ditno.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 39 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andy@ditno.com</customfieldvalue>
            <customfieldvalue>sam.kleinman</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrl68n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hs98in:</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|hsa1tj:</customfieldvalue>

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