<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:25 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>[JAVA-494] Poor performance due to SimplePool._get() and SimplePool.done()</title>
                <link>https://jira.mongodb.org/browse/JAVA-494</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;We are experiencing major bottleneck around following two calls on load, percentage time consumed by these two calls are given below. &lt;/p&gt;

&lt;p&gt;com.mongodb.util.SimplePool._get() (42%)&lt;br/&gt;
com.mongodb.util.SimplePool.done() (37%)&lt;/p&gt;

&lt;p&gt;Please let us know if this is a known issue and there exist a fix for the same?&lt;br/&gt;
Do we have any alternative to the SimplePool, which handles get and put connection more efficiently?&lt;/p&gt;




</description>
                <environment>Linux 64 bit, &lt;br/&gt;
Mongo server 2.x ,&lt;br/&gt;
driver 2.7.1</environment>
        <key id="27097">JAVA-494</key>
            <summary>Poor performance due to SimplePool._get() and SimplePool.done()</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="9">Done</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="atiwari">Arvind Tiwari</reporter>
                        <labels>
                            <label>connection</label>
                    </labels>
                <created>Wed, 21 Dec 2011 22:28:40 +0000</created>
                <updated>Wed, 19 Oct 2016 22:26:13 +0000</updated>
                            <resolved>Tue, 26 Nov 2013 15:14:55 +0000</resolved>
                                                                    <component>Connection Management</component>
                    <component>Performance</component>
                                        <votes>2</votes>
                                    <watches>5</watches>
                                                                                                                                                            <comments>
                            <comment id="377739" author="jeff.yemin" created="Wed, 10 Jul 2013 02:52:14 +0000"  >&lt;p&gt;Before this change, the driver&apos;s internal connection pool made a best effort to provide thread affinity to the pooled connections.  This behavior was not documented, nor was it reliable if the number of threads exceeded the number of pooled connections.&lt;/p&gt;

&lt;p&gt;This commit removes thread affinity in the connection pool, so applications that rely on this thread affinity will not work as they used to.  This is most likely to occur in applications that:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;use unacknowledged writes (see WriteConcern.UNACKNOWLEDGED)&lt;/li&gt;
	&lt;li&gt;expect those writes to be visible to subsequent reads on the same thread&lt;/li&gt;
	&lt;li&gt;do not surround these reads and writes with calls to DB.requestStart/requestDone.&lt;/li&gt;
&lt;/ol&gt;
</comment>
                            <comment id="377735" author="jeff.yemin" created="Wed, 10 Jul 2013 02:41:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Branch: 3.0.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/e2b285c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/e2b285c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="366996" author="jeff.yemin" created="Tue, 25 Jun 2013 04:04:21 +0000"  >&lt;p&gt;Planning to make the pool non-blocking for the 3.0 release.&lt;/p&gt;</comment>
                            <comment id="142891" author="jeff.yemin" created="Fri, 13 Jul 2012 20:13:06 +0000"  >&lt;p&gt;Paul, can you describe a bit more what you&apos;re seeing, including:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;any connection pool sizing customizations in MongoOptions&lt;/li&gt;
	&lt;li&gt;a series of full thread dumps over time&lt;/li&gt;
&lt;/ol&gt;
</comment>
                            <comment id="142883" author="pmokbel" created="Fri, 13 Jul 2012 19:38:32 +0000"  >&lt;p&gt;We&apos;re also experiencing mega contention here under load.&lt;/p&gt;

&lt;p&gt;&quot;http-80-156&quot; daemon prio=10 tid=0x00007f5c58d8b000 nid=0x6189 waiting for monitor entry &lt;span class=&quot;error&quot;&gt;&amp;#91;0x00007f5c43d7c000&amp;#93;&lt;/span&gt;&lt;br/&gt;
 &#160; java.lang.Thread.State: BLOCKED (on object monitor)&lt;br/&gt;
 &#160; &#160; &#160; &#160;at com.mongodb.util.SimplePool.done(SimplePool.java:111)&lt;br/&gt;
 &#160; &#160; &#160; &#160;- waiting to lock &amp;lt;0x00007f5c7487c920&amp;gt; (a java.util.ArrayList)&lt;br/&gt;
 &#160; &#160; &#160; &#160;at com.mongodb.util.SimplePool.done(SimplePool.java:94)&lt;br/&gt;
 &#160; &#160; &#160; &#160;at com.mongodb.DBTCPConnector$MyPort.done(DBTCPConnector.java:344)&lt;br/&gt;
 &#160; &#160; &#160; &#160;at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:223)&lt;br/&gt;
 &#160; &#160; &#160; &#160;at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:296)&lt;br/&gt;
 &#160; &#160; &#160; &#160;at com.mongodb.DBCollection.findOne(DBCollection.java:558)&lt;br/&gt;
 &#160; &#160; &#160; &#160;at com.sitescout.dsp.capmanage.UserFrequency.getByKey(UserFrequency.java:37)&lt;br/&gt;
 &#160; &#160; &#160; &#160;at com.sitescout.dsp.capmanage.UserFrequency.getTimestamps(UserFrequency.java:42)&lt;/p&gt;
</comment>
                            <comment id="121894" author="jeff.yemin" created="Tue, 22 May 2012 14:50:45 +0000"  >&lt;p&gt;Attached MongoUpsertContentionTest, a benchmark for testing the affect of the connection pool on overall driver performance.&lt;/p&gt;</comment>
                            <comment id="76194" author="jeff.yemin" created="Tue, 27 Dec 2011 22:12:09 +0000"  >&lt;p&gt;Let us know if you&apos;re still unable to create the new issue, and we&apos;ll walk you through it step by step.&lt;/p&gt;</comment>
                            <comment id="76186" author="jeff.yemin" created="Tue, 27 Dec 2011 21:49:34 +0000"  >&lt;p&gt;Arvind, &lt;/p&gt;

&lt;p&gt;You should see two drop-downs when you go to create an issue. You&apos;re looking at the second drop-down, labelled &quot;Issue Type&quot;  The first drop-down, labelled &quot;Project&quot;, is where you should see &quot;Commercial Support&quot; as an option.  If you don&apos;t see that project name, use &quot;Community Private&quot;&lt;/p&gt;</comment>
                            <comment id="76151" author="atiwari" created="Tue, 27 Dec 2011 19:33:18 +0000"  >&lt;p&gt;I am not seeing the option &quot;project&quot;, following are the options I am getting&lt;/p&gt;

&lt;p&gt;Bug&lt;br/&gt;
New Feature&lt;br/&gt;
Question&lt;br/&gt;
Task&lt;br/&gt;
Improvement&lt;/p&gt;</comment>
                            <comment id="76150" author="scotthernandez" created="Tue, 27 Dec 2011 19:28:09 +0000"  >&lt;p&gt;You create a Customer Support jira issue. It is a type (project) of issue you can choose when you create new issue. See the upper right hand corner of this web page.&lt;/p&gt;</comment>
                            <comment id="76149" author="atiwari" created="Tue, 27 Dec 2011 19:24:24 +0000"  >&lt;p&gt;Please tell me how to create the &quot;CS issue&quot;, I did not get any information on that.&lt;/p&gt;</comment>
                            <comment id="76033" author="scotthernandez" created="Mon, 26 Dec 2011 23:34:57 +0000"  >&lt;p&gt;No, anything is a cs issue is private.&lt;/p&gt;</comment>
                            <comment id="76032" author="atiwari" created="Mon, 26 Dec 2011 23:30:18 +0000"  >&lt;p&gt;In that case my snapshot will not be publicly accessible? &lt;/p&gt;</comment>
                            <comment id="76027" author="scotthernandez" created="Mon, 26 Dec 2011 22:32:51 +0000"  >&lt;p&gt;Any CS issue can be linked to this. Just create a CS issue, attache the files, and click the &quot;more actions&quot; button to select the link action.&lt;/p&gt;</comment>
                            <comment id="76026" author="atiwari" created="Mon, 26 Dec 2011 22:21:37 +0000"  >&lt;p&gt;Please let me know how to open ticket with commercial support queue (hope that wd not be public?) as I do not want to attach the snapshot in public forum.&lt;/p&gt;</comment>
                            <comment id="75432" author="jeff.yemin" created="Thu, 22 Dec 2011 15:23:13 +0000"  >&lt;p&gt;Arvind,&lt;/p&gt;

&lt;p&gt;Please attach a YourKit snapshot of the profiling run.  Alternatively, you can open a ticket in the commercial support queue and attach it there.&lt;/p&gt;</comment>
                            <comment id="75346" author="scotthernandez" created="Thu, 22 Dec 2011 04:01:25 +0000"  >&lt;p&gt;It sounds like you are setting maxConnectionsPerHost=800, and have 300 concurrent web requests, is that correct? Can you post a bit more about the test config, including your MongoOptions, the app-server/host-env., the number of threads used for testing, and such?&lt;/p&gt;

&lt;p&gt;You can try using db.requestStart/Done at the start/end of the request to keep the thread from needing to go to the connection pool for the request lifetime, but I suspect that there is something else going on here.&lt;/p&gt;</comment>
                            <comment id="75340" author="jeff.yemin" created="Thu, 22 Dec 2011 03:35:07 +0000"  >&lt;p&gt;From the bmp it looks like you&apos;re using the YourKit profiler.  Can you run again with Monitor Profiling enable to see if some of this is due to monitor contention?&lt;/p&gt;</comment>
                            <comment id="75265" author="atiwari" created="Wed, 21 Dec 2011 22:54:23 +0000"  >&lt;p&gt;Attached the profiler hot spot page. Following is the test case&lt;/p&gt;

&lt;p&gt;We are load testing a particular API&lt;br/&gt;
1. 800 connection configured&lt;br/&gt;
2. 1 request is composed of 8/10 DB calls, most of the calls are DB read, except 2 which writes to the  DB (with WriteConcern none).&lt;br/&gt;
3. 300 concurrent user making the request.&lt;/p&gt;



</comment>
                            <comment id="75256" author="scotthernandez" created="Wed, 21 Dec 2011 22:37:08 +0000"  >&lt;p&gt;What constitutes the rest of the time? What else was being profiled? Can you provide the full profiler results or test case?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="16764" name="MongoUpsertContentionTest.java" size="8062" author="jeff.yemin@mongodb.com" created="Tue, 22 May 2012 14:50:45 +0000"/>
                            <attachment id="14217" name="profiler.bmp" size="5764806" author="atiwari" created="Wed, 21 Dec 2011 22:48:27 +0000"/>
                    </attachments>
                <subtasks>
                            <subtask id="93894">JAVA-1006</subtask>
                            <subtask id="93896">JAVA-1007</subtask>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10011"><![CDATA[Minor Change]]></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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrhbfr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14653</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>