<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:59:56 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-2430] Indexed capped collection performance degrades after there are thousands of entries </title>
                <link>https://jira.mongodb.org/browse/SERVER-2430</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Initially, two capped collections were created to implement &quot;cache&quot; feature.&lt;/p&gt;

&lt;p&gt;db.createCollection(&quot;purchase&quot;, &lt;/p&gt;
{capped:true, size:10000000}
&lt;p&gt;)&lt;br/&gt;
db.purchase.ensureIndex(&lt;/p&gt;
{key:1, ts:-1}
&lt;p&gt;, &lt;/p&gt;
{background:true}
&lt;p&gt;);&lt;br/&gt;
db.createCollection(&quot;refinance&quot;, &lt;/p&gt;
{capped:true, size:10000000}
&lt;p&gt;)&lt;br/&gt;
db.refinance.ensureIndex(&lt;/p&gt;
{key:1, ts: -1}
&lt;p&gt;, &lt;/p&gt;
{background:true}
&lt;p&gt;);&lt;/p&gt;


&lt;p&gt;The lookup query is done via&lt;/p&gt;

&lt;p&gt;Date now = new Date();&lt;br/&gt;
					BasicDBObject dbQuery = new BasicDBObject();&lt;br/&gt;
					dbQuery.put(KEY_FIELD_NAME, requestSignature);&lt;br/&gt;
					dbQuery.put(TIMESTAMP_FIELD_NAME, new BasicDBObject(&quot;$gt&quot;,&lt;br/&gt;
							now.getTime() - query_offer_cache_expiration));&lt;/p&gt;

&lt;p&gt;					cur = coll.find(dbQuery).addOption(&lt;br/&gt;
							Bytes.QUERYOPTION_SLAVEOK).sort(&lt;br/&gt;
							getMongoDBSortCriteria()).limit(1);&lt;/p&gt;

&lt;p&gt;We&apos;ve three servers, each has 24 CPUs w/ total 48G.&lt;/p&gt;

&lt;p&gt;We see the query performance seems to degrade after we&apos;ve thousands of documents. To get thing moving again, we dropped capped collections and recreated them. Now stats whos&lt;/p&gt;

&lt;p&gt;&amp;gt; db.refinance.stats()&lt;br/&gt;
{&lt;br/&gt;
        &quot;ns&quot; : &quot;mortgagecache.refinance&quot;,&lt;br/&gt;
        &quot;count&quot; : 591,&lt;br/&gt;
        &quot;size&quot; : 1235880,&lt;br/&gt;
        &quot;avgObjSize&quot; : 2091.167512690355,&lt;br/&gt;
        &quot;storageSize&quot; : 10000128,&lt;br/&gt;
        &quot;numExtents&quot; : 1,&lt;br/&gt;
        &quot;nindexes&quot; : 1,&lt;br/&gt;
        &quot;lastExtentSize&quot; : 10000128,&lt;br/&gt;
        &quot;paddingFactor&quot; : 1,&lt;br/&gt;
        &quot;flags&quot; : 0,&lt;br/&gt;
        &quot;totalIndexSize&quot; : 65536,&lt;br/&gt;
        &quot;indexSizes&quot; : &lt;/p&gt;
{
                &quot;key_1_ts_-1&quot; : 65536
        }
&lt;p&gt;,&lt;br/&gt;
        &quot;capped&quot; : 1,&lt;br/&gt;
        &quot;max&quot; : 2147483647,&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Attaching the cache code&lt;/p&gt;</description>
                <environment></environment>
        <key id="14347">SERVER-2430</key>
            <summary>Indexed capped collection performance degrades after there are thousands of entries </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="4">Incomplete</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="joseph.wang">Joseph Wang </reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 Jan 2011 23:36:51 +0000</created>
                <updated>Tue, 29 May 2012 14:53:31 +0000</updated>
                            <resolved>Fri, 2 Sep 2011 04:49:42 +0000</resolved>
                                    <version>1.6.3</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="52124" author="eliot" created="Fri, 2 Sep 2011 04:49:58 +0000"  >&lt;p&gt;Note this may have been addressed in 1.8 with better index compaction&lt;/p&gt;</comment>
                            <comment id="25352" author="eliot" created="Sun, 6 Mar 2011 06:53:51 +0000"  >&lt;p&gt;Can you provide stats when things are not performing well?&lt;br/&gt;
For example, if your index is bigger than ram and your&apos;e doing random reads, it will be slow.&lt;/p&gt;</comment>
                            <comment id="25295" author="joseph.wang" created="Fri, 4 Mar 2011 23:37:07 +0000"  >&lt;p&gt;any comment? suggestion?&lt;/p&gt;</comment>
                            <comment id="22968" author="joseph.wang" created="Wed, 2 Feb 2011 00:21:21 +0000"  >&lt;p&gt;for capped (indexed) collection, what is the performance difference between capping the number of entries vs the size?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="10755" name="MongoMortgageQueryOffersCache.java" size="6901" author="joseph.wang" created="Fri, 28 Jan 2011 23:36:51 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sun, 6 Mar 2011 06:53:51 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 24 weeks, 5 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>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 24 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>joseph.wang</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrijkn:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>20734</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|hri9un:</customfieldvalue>

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