<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:53:22 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-20167] Avoid spinlock in TimerStats</title>
                <link>https://jira.mongodb.org/browse/SERVER-20167</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;As we saw in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20091&quot; title=&quot;Poor query throughput and erratic behavior at high connection counts under WiredTiger&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20091&quot;&gt;&lt;del&gt;SERVER-20091&lt;/del&gt;&lt;/a&gt;, using a spinlock in situations where a large number of threads can contend for a resource can lead to scalability issues and erratic behavior. Code inspection reveals an additional place where this might occur: TimerStats uses a spinlock to make updates to the count and the total time atomic, and this is used by gleWtimeStats, which can potentially be updated by a large number of threads at high connection count. We could avoid this by&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;using a mutex instead of a spinlock&lt;/li&gt;
	&lt;li&gt;don&apos;t use any lock, use atomics for the individual stats (count and total milliseconds), accept the possibility of a small skew between the two. I think this is probably acceptable for the typical uses of this statistic.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I haven&apos;t been able to demonstrate a performance issue for this because this stat is only update for write concern with w&amp;gt;1 or j:true, and both of those have other performance issues that dominate at the moment. Independent of that however, it seems like a good idea to forestall performance pitfalls for future uses of this class.&lt;/p&gt;</description>
                <environment></environment>
        <key id="227417">SERVER-20167</key>
            <summary>Avoid spinlock in TimerStats</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="martin.bligh">Martin Bligh</assignee>
                                    <reporter username="bruce.lucas@mongodb.com">Bruce Lucas</reporter>
                        <labels>
                    </labels>
                <created>Thu, 27 Aug 2015 20:12:47 +0000</created>
                <updated>Sat, 19 Sep 2015 00:11:11 +0000</updated>
                            <resolved>Thu, 27 Aug 2015 21:46:50 +0000</resolved>
                                                    <fixVersion>3.1.8</fixVersion>
                                    <component>Concurrency</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="1018383" author="xgen-internal-githook" created="Mon, 31 Aug 2015 17:10:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;martinbligh&apos;, u&apos;name&apos;: u&apos;Martin Bligh&apos;, u&apos;email&apos;: u&apos;mbligh@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20167&quot; title=&quot;Avoid spinlock in TimerStats&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20167&quot;&gt;&lt;del&gt;SERVER-20167&lt;/del&gt;&lt;/a&gt;: Flip stats counters to be signed (forgot const type)&lt;br/&gt;
Branch: v3.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/284e8b79c02ec00380a667c19b662fccaf61b7f4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/284e8b79c02ec00380a667c19b662fccaf61b7f4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1018206" author="xgen-internal-githook" created="Mon, 31 Aug 2015 14:28:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;martinbligh&apos;, u&apos;name&apos;: u&apos;Martin Bligh&apos;, u&apos;email&apos;: u&apos;mbligh@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20167&quot; title=&quot;Avoid spinlock in TimerStats&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20167&quot;&gt;&lt;del&gt;SERVER-20167&lt;/del&gt;&lt;/a&gt;: Flip stats counters to be signed (forgot const type)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/518118bfce4da06e6c26063e125f90e30a1b3baa&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/518118bfce4da06e6c26063e125f90e30a1b3baa&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1018145" author="xgen-internal-githook" created="Mon, 31 Aug 2015 13:39:29 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;martinbligh&apos;, u&apos;name&apos;: u&apos;Martin Bligh&apos;, u&apos;email&apos;: u&apos;mbligh@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20167&quot; title=&quot;Avoid spinlock in TimerStats&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20167&quot;&gt;&lt;del&gt;SERVER-20167&lt;/del&gt;&lt;/a&gt;: Flip stats counters to be signed&lt;br/&gt;
Branch: v3.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/dea495557e21478e9783bbce7c5d6b6463358052&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/dea495557e21478e9783bbce7c5d6b6463358052&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1018144" author="xgen-internal-githook" created="Mon, 31 Aug 2015 13:37:42 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;martinbligh&apos;, u&apos;name&apos;: u&apos;Martin Bligh&apos;, u&apos;email&apos;: u&apos;mbligh@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20167&quot; title=&quot;Avoid spinlock in TimerStats&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20167&quot;&gt;&lt;del&gt;SERVER-20167&lt;/del&gt;&lt;/a&gt;: Flip stats counters to be signed&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2b209d7b214bee35b8890f33534254c7a94182f2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2b209d7b214bee35b8890f33534254c7a94182f2&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1016867" author="martin.bligh" created="Fri, 28 Aug 2015 12:31:50 +0000"  >&lt;p&gt;Don&apos;t think so, this one is speculative from code inspection. I&apos;ll do the network stats one though&lt;/p&gt;</comment>
                            <comment id="1016430" author="xgen-internal-githook" created="Thu, 27 Aug 2015 21:45:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;martinbligh&apos;, u&apos;name&apos;: u&apos;Martin Bligh&apos;, u&apos;email&apos;: u&apos;mbligh@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20167&quot; title=&quot;Avoid spinlock in TimerStats&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20167&quot;&gt;&lt;del&gt;SERVER-20167&lt;/del&gt;&lt;/a&gt;: use atomics for TimerStats&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c9d635404d514336a5f6ca50bf0a13f385e92bfc&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c9d635404d514336a5f6ca50bf0a13f385e92bfc&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="226794">SERVER-20091</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 27 Aug 2015 21:45:45 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 24 weeks, 2 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>
                            8 years, 24 weeks, 2 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>bruce.lucas@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>martin.bligh</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrkw5b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hscs13:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="641">QuInt 8 08/28/15</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|hsfpmv:</customfieldvalue>

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