<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:10:30 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-6004] Intensive reading/writing causes reader/writer starvation</title>
                <link>https://jira.mongodb.org/browse/SERVER-6004</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;While trying some new stuff on our sharded and replicated production cluster, involving heavy bursts of writing (e.g. 6000 writes/s), we saw a severe performance degradation: big replication lag, lots of timeouts on reads... We tried to reproduce the issue in tests and got results similar to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3663&quot; title=&quot;Mongod on windows performance degrades over time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3663&quot;&gt;&lt;del&gt;SERVER-3663&lt;/del&gt;&lt;/a&gt;. For example, when running 10 writers, we have more than 9000 writes/s, and then when we add 100 readers, the writes collapse to somewhere between 1 and 5 writes/s (while readers happily perform at 3000 reads/s). When we stop the readers, the writes get back to 9000 writes/s. When running 10 readers on a slave, they perform at 1000 reads/s when replication is idle, but go down to 50-100 reads/s when replication is taking place... When running a big number of writers to insert data, after a little while the performances are horrendous and randomly bounce around between plain 0 and spikes at 1000 writes/s.&lt;/p&gt;

&lt;p&gt;We think that one possible cause is that the read-write locking is not fair. I&apos;ve seen that the lock classes are made of layers of encapsulation around one of several read-write lock back ends: is there any special fairness logic that I missed, implemented in these mongodb layers? In our case, the back end used is the shared_mutex of boost. We&apos;ve been experimenting some changes to it to improve its fairness and it gives some significant results on the behavior of mongodb as mentioned above.&lt;/p&gt;

&lt;p&gt;I&apos;ve read other tickets related to this kind of issue (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3663&quot; title=&quot;Mongod on windows performance degrades over time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3663&quot;&gt;&lt;del&gt;SERVER-3663&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3609&quot; title=&quot;write starvation can make secondaries fall behind when under heavy load&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3609&quot;&gt;&lt;del&gt;SERVER-3609&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3801&quot; title=&quot;Mapreduce should yield periodically when writing&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3801&quot;&gt;&lt;del&gt;SERVER-3801&lt;/del&gt;&lt;/a&gt;...). We consider our use-case that made us come across this issue as normal operation, we can&apos;t separate readers and writers and don&apos;t think that the right approach here is to consolidate or throttle our writes or more generally try to avoid the situations where fairness is necessary.&lt;/p&gt;</description>
                <environment>Linux x64, boost 1.41</environment>
        <key id="40457">SERVER-6004</key>
            <summary>Intensive reading/writing causes reader/writer starvation</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="5">Cannot Reproduce</resolution>
                                        <assignee username="benjamin.becker">Ben Becker</assignee>
                                    <reporter username="linkfanel">Pierre Ynard</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jun 2012 15:59:29 +0000</created>
                <updated>Wed, 10 Dec 2014 23:19:19 +0000</updated>
                            <resolved>Fri, 24 Jan 2014 19:36:11 +0000</resolved>
                                    <version>2.0.5</version>
                                                    <component>Performance</component>
                    <component>Stability</component>
                                        <votes>1</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="487494" author="benjamin.becker" created="Fri, 24 Jan 2014 19:36:11 +0000"  >&lt;p&gt;Thanks for the feedback.  I ran a similar workload in javascript using 16 concurrent shells, but I&apos;m not able to reproduce the issue against v2.0.9.&lt;/p&gt;</comment>
                            <comment id="484237" author="linkfanel" created="Mon, 20 Jan 2014 01:04:46 +0000"  >&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I don&apos;t really remember but I suppose so, why else would I have attached a test sample? Anyway I believe the problem is not relevant anymore since we migrated to 2.2 with the new locking logic.&lt;/p&gt;</comment>
                            <comment id="481468" author="benjamin.becker" created="Tue, 14 Jan 2014 01:41:55 +0000"  >&lt;p&gt;Hi Pierre,&lt;/p&gt;

&lt;p&gt;It seems that the attached script generates 100,000 documents, each with a random &apos;ii&apos; key, and then generates queries for another 100,000,000 queries, each with a random &apos;ii&apos; value between 0 and 100,000.  This means that some queries should not find any documents, but exactly how many depends on the implementation of &lt;tt&gt;Random.next()&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Does the attached script produce the reported behavior for you?&lt;/p&gt;</comment>
                            <comment id="126432" author="eliot" created="Tue, 5 Jun 2012 16:06:46 +0000"  >&lt;p&gt;That doesn&apos;t totally make sense to me.&lt;br/&gt;
Can you send the code of the test you are running?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="17077" name="Program.cs" size="2425" author="kamaradclimber" created="Thu, 7 Jun 2012 07:35:39 +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>Tue, 5 Jun 2012 16:06:46 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        10 years, 3 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            10 years, 3 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_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>benjamin.becker</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>linkfanel</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hro0zj:</customfieldvalue>

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

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

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