<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:47:05 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-37810] Optimise balancer performance with zone sharding</title>
                <link>https://jira.mongodb.org/browse/SERVER-37810</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Reproduced in MongoDB 3.4.16 and 4.0.3.&lt;/p&gt;

&lt;p&gt;With a considerable number of chunks (1+ million), the balancer is observed to spend a large amount of time checking each chunk for belonging to a tag. This can lead to a situation where a balancer round spends most of its time finding a candidate chunk (e.g. one minute) rather than migrating a chunk. This can have a significant impact on the overall cluster balancing performance.&lt;/p&gt;

&lt;p&gt;Below is the a repro where the balancer spends 90% of its time finding a candidate chunk, and only 10% of its time moving the chunk.&lt;/p&gt;

&lt;p&gt;Off-CPU profiling suggests that the balancer thread is CPU-bound. Attached a 60-second flame graph of the 3.4.16 CSRS primary process. The CSRS primary is only balancing the cluster at that time.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/199858/199858_onCPU-CSRS-primary.png&quot; width=&quot;100%&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Most CPU time is consumed in &lt;tt&gt;BSONObj:woCompare()&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="626548">SERVER-37810</key>
            <summary>Optimise balancer performance with zone sharding</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="3">Duplicate</resolution>
                                        <assignee username="tommaso.tocci@mongodb.com">Tommaso Tocci</assignee>
                                    <reporter username="josef.ahmad@mongodb.com">Josef Ahmad</reporter>
                        <labels>
                            <label>ShardingRoughEdges</label>
                            <label>balancer-round-perf</label>
                            <label>high-value</label>
                            <label>shardingemea-qw</label>
                    </labels>
                <created>Tue, 30 Oct 2018 09:22:53 +0000</created>
                <updated>Fri, 29 Sep 2023 10:11:35 +0000</updated>
                            <resolved>Thu, 28 Sep 2023 17:47:47 +0000</resolved>
                                                                    <component>Sharding</component>
                                        <votes>4</votes>
                                    <watches>31</watches>
                                                                                                                <comments>
                            <comment id="5740127" author="garaudy.etienne" created="Fri, 29 Sep 2023 10:11:35 +0000"  >&lt;p&gt;To be explicitly clear: This issue is the same as &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40459&quot; title=&quot;Optimize the construction of the balancer&amp;#39;s collection distribution status histogram&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40459&quot;&gt;&lt;del&gt;SERVER-40459&lt;/del&gt;&lt;/a&gt;, which has now been fixed in 4.4+. &lt;/p&gt;</comment>
                            <comment id="5738573" author="JIRAUSER1270641" created="Thu, 28 Sep 2023 18:12:12 +0000"  >&lt;p&gt;Balancer performance with zone sharding performance has increased with due to the following enhancements - &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-80488&quot; title=&quot;Avoid traversing routing table in balancer split chunk policy&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-80488&quot;&gt;&lt;del&gt;SERVER-80488&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-80703&quot; title=&quot;Avoid traversing routing table in MigrationDestinationManager&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-80703&quot;&gt;&lt;del&gt;SERVER-80703&lt;/del&gt;&lt;/a&gt;, and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40459&quot; title=&quot;Optimize the construction of the balancer&amp;#39;s collection distribution status histogram&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40459&quot;&gt;&lt;del&gt;SERVER-40459&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With most of the poor performance due to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40459&quot; title=&quot;Optimize the construction of the balancer&amp;#39;s collection distribution status histogram&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40459&quot;&gt;&lt;del&gt;SERVER-40459&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2045930" author="kaloian.manassiev" created="Tue, 30 Oct 2018 09:43:45 +0000"  >&lt;p&gt;Thank you &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=josef.ahmad&quot; class=&quot;user-hover&quot; rel=&quot;josef.ahmad&quot;&gt;josef.ahmad&lt;/a&gt; for the detailed report and for the heat map!&lt;/p&gt;

&lt;p&gt;Looking at it, this is effectively the same issue as &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-32526&quot; title=&quot;Use KeyString for the ChunkManager&amp;#39;s ChunkMap key instead of BSONObj&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-32526&quot;&gt;&lt;del&gt;SERVER-32526&lt;/del&gt;&lt;/a&gt; and there are two things that can be optimized:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Use KeyString for the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8dca4a066df2418c90c517fee3e656813697b5fa/src/mongo/db/s/balancer/balancer_policy.h#L156&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;ShardToChunksMap&lt;/tt&gt;&lt;/a&gt; in the &lt;tt&gt;DistributionStatus&lt;/tt&gt; class&lt;/li&gt;
	&lt;li&gt;Reduce the number of times we construct &lt;tt&gt;DistributionStatus&lt;/tt&gt; for the different stages of the balancer - 1) when selecting &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8dca4a066df2418c90c517fee3e656813697b5fa/src/mongo/db/s/balancer/balancer.cpp#L527&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;chunks to split&lt;/a&gt; and 2) when selecting &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8dca4a066df2418c90c517fee3e656813697b5fa/src/mongo/db/s/balancer/balancer.cpp#L373&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;chunks to move&lt;/a&gt; (if the previous operation didn&apos;t do any splits).&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="728865">SERVER-40459</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="478233">SERVER-32526</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="199858" name="onCPU-CSRS-primary.png" size="645493" author="josef.ahmad@mongodb.com" created="Tue, 30 Oct 2018 08:34:55 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25133"><![CDATA[Sharding EMEA]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_23577" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>CAR Impact</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25716"><![CDATA[3 High (users + team + external teams)]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000dHLtIQAW, 500A000000as8sFIAQ, 500A000000cEwy1IAC, 5002K00000f1FOZQA2, 5002K00000hSHLHQA4, 5002K00000gn8aLQAQ, 5002K00000odLo5QAE]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 30 Oct 2018 09:43:45 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        18 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>garaudy.etienne@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            18 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>garaudy.etienne@mongodb.com</customfieldvalue>
            <customfieldvalue>josef.ahmad@mongodb.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>matt.panton@mongodb.com</customfieldvalue>
            <customfieldvalue>tommaso.tocci@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hubn0n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu1won:</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_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </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|hub99z:</customfieldvalue>

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