<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:46:35 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>[CSHARP-3885] [Unconfigurable] connection rate limiter in 2.13.x breaks existing applications</title>
                <link>https://jira.mongodb.org/browse/CSHARP-3885</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;The resolution for the &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-3305&quot; title=&quot;Rate limit new connection creations (maxConnecting)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-3305&quot;&gt;&lt;del&gt;CSHARP-3305&lt;/del&gt;&lt;/a&gt; issue introduced the limit on simultaneous connection attempts. Unfortunately, this breaks some existing applications when upgrading to 2.13.x, if they operate under considerable load with high concurrency, especially when using co-hosted &lt;tt&gt;mongos&lt;/tt&gt; instance.&lt;br/&gt;
I surely understand that you would like to prevent overloading the server with a lot of connections. We even implemented similar measures by introducing a delay in &lt;tt&gt;IEventSubscriber.ConnectionPoolAddingConnectionEvent&lt;/tt&gt; handler. Unfortunately, the apparent lack of ability to disable it or configure the &lt;tt&gt;MongoInternalDefaults.ConnectionPool.MaxConnecting&lt;/tt&gt; blocks the upgrade to 2.13.x for us quite possibly may affect other users.&lt;/p&gt;

&lt;p&gt;I would like to ask you to expose the &lt;tt&gt;MaxConnecting&lt;/tt&gt; parameter so driver users can tune it to their liking and disable it.&lt;/p&gt;

&lt;p&gt;Thank you,&lt;br/&gt;
Aristarkh Zagorodnikov&lt;/p&gt;</description>
                <environment></environment>
        <key id="1886772">CSHARP-3885</key>
            <summary>[Unconfigurable] connection rate limiter in 2.13.x breaks existing applications</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="13201">Fixed</resolution>
                                        <assignee username="boris.dogadov@mongodb.com">Boris Dogadov</assignee>
                                    <reporter username="onyxmaster">Aristarkh Zagorodnikov</reporter>
                        <labels>
                            <label>connections</label>
                            <label>pooling</label>
                    </labels>
                <created>Thu, 30 Sep 2021 08:35:42 +0000</created>
                <updated>Sat, 28 Oct 2023 11:47:29 +0000</updated>
                            <resolved>Tue, 11 Jan 2022 22:36:35 +0000</resolved>
                                                    <fixVersion>2.14.0</fixVersion>
                                    <component>Connectivity</component>
                                        <votes>3</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="4287071" author="JIRAUSER1257742" created="Tue, 11 Jan 2022 22:36:35 +0000"  >&lt;p&gt;Fixed in&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-3952&quot; title=&quot;Make maxConnecting configurable&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-3952&quot;&gt;&lt;del&gt;CSHARP-3952&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4287068" author="JIRAUSER1257742" created="Tue, 11 Jan 2022 22:35:50 +0000"  >&lt;p&gt;Thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=onyxmaster&quot; class=&quot;user-hover&quot; rel=&quot;onyxmaster&quot;&gt;onyxmaster&lt;/a&gt;, closing.&lt;/p&gt;</comment>
                            <comment id="4283598" author="onyxmaster" created="Mon, 10 Jan 2022 17:21:14 +0000"  >&lt;p&gt;Since &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-3952&quot; title=&quot;Make maxConnecting configurable&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-3952&quot;&gt;&lt;del&gt;CSHARP-3952&lt;/del&gt;&lt;/a&gt; was implemented, maybe this one should be closed?&lt;/p&gt;</comment>
                            <comment id="4175115" author="JIRAUSER1269368" created="Mon, 8 Nov 2021 16:53:08 +0000"  >&lt;p&gt;Thanks a lot, we reverted the driver and can confirm that with the latest version (12.4) application come back at full speed.&lt;br/&gt;
I&apos;ll wait for the resolution of this issue before upgrading to new version.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                            <comment id="4174913" author="JIRAUSER1257742" created="Mon, 8 Nov 2021 16:05:57 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alkampfer&quot; class=&quot;user-hover&quot; rel=&quot;alkampfer&quot;&gt;alkampfer&lt;/a&gt;, thank you for your report.&lt;br/&gt;
We are working on a fix, please follow this ticket for further updates.&lt;/p&gt;</comment>
                            <comment id="4171639" author="JIRAUSER1269368" created="Fri, 5 Nov 2021 14:42:44 +0000"  >&lt;p&gt;Actually a large application I&apos;m working into was completely wasted upgrading from 2.12 to 2.13.2 version of the driver. We have critical paths where lots of threads are upgrading a checkpoint collection. Randomly all those thread were blocked, and we experienced from our log that a single document upgrade took 10 seconds or more.&#160;&lt;br/&gt;
Debugging the drivers we found that all threads are blocked in acquire method (see picture above, where I have this situation for almost 10 seconds). Changing MongoInternalDefaults.ConnectionPool.MaxConnecting value from 2 to some value like 100 seems to solve the problem.&lt;/p&gt;

&lt;p&gt;I think that such impacting settings should left public to be changed by user of the driver, the risk of breaking existing code is enormous.&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/344279/344279_image-2021-11-05-15-40-01-037.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="4097203" author="JIRAUSER1257742" created="Fri, 1 Oct 2021 18:10:05 +0000"  >&lt;p&gt;Thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=onyxmaster&quot; class=&quot;user-hover&quot; rel=&quot;onyxmaster&quot;&gt;onyxmaster&lt;/a&gt;,&#160;&lt;br/&gt;
We are looking into this issue, please follow this ticket for further updates.&lt;/p&gt;</comment>
                            <comment id="4095876" author="onyxmaster" created="Fri, 1 Oct 2021 05:31:10 +0000"  >&lt;p&gt;Sure.&lt;br/&gt;
The service is a &lt;a href=&quot;https://github.com/drivenet/gridfs_server&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;GridFS HTTP proxy&lt;/a&gt; upstream to co-hosted nginx and connects to a local mongos (4.4.9), which connects to the sharded cluster on the same network. The mongos instance has the &lt;tt&gt;taskExecutorPoolSize&lt;/tt&gt; parameter set to 0 to prevent reconnection issues. The load is about 300 requests per second, but since they serve objects from GridFS, the request execution time is often considerable (hundreds of milliseconds, sometimes seconds). When we restart the service in question, there is, of course, a set of reconnections.&lt;br/&gt;
The service and mongos run on Ubuntu 20.04 with a 5.4 kernel on physical hardware, which has 2xE5-2630v2 CPUs and 128GB of RAM.&lt;br/&gt;
The connection settings are all the default ones, except the minimum pool size set to 100 and the maximum set to 1000.&lt;/p&gt;

&lt;p&gt;Before the 2.13 (in fact, I manually bisected the 2.12-&amp;gt;2.13 history and arrived at commit &lt;tt&gt;59a1268d8c1fa905820d7789dd2f86b350dc7648&lt;/tt&gt;, which is how I found out about &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-3305&quot; title=&quot;Rate limit new connection creations (maxConnecting)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-3305&quot;&gt;&lt;del&gt;CSHARP-3305&lt;/del&gt;&lt;/a&gt;), the reconnection worked reliably (we used 2.12.4). After upgrading to 2.13.1, the service restarts leads to a bunch of timeouts. Since the pressure doesn&apos;t lift because the requests keep arriving, it gets limited with the Kestrel (ASP.NET Core HTTP server) connection limiter. It often can&apos;t recover from the stalling, perhaps due to many tasks scheduled and a high GC load due to requests piled up. Also, in some cases, it leads to OOM exceptions since we&apos;ve got &lt;tt&gt;COMPlus_GCHeapHardLimit=0x40000000&lt;/tt&gt; set. Raising it is not a problem, but before 2.13, we didn&apos;t have issues like that, so I&apos;m reluctant to &quot;fixing&quot; this issue by just giving it more resources.&lt;/p&gt;</comment>
                            <comment id="4095295" author="JIRAUSER1257742" created="Thu, 30 Sep 2021 20:37:37 +0000"  >&lt;p&gt;Thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=onyxmaster&quot; class=&quot;user-hover&quot; rel=&quot;onyxmaster&quot;&gt;onyxmaster&lt;/a&gt;&#160;for your question.&lt;br/&gt;
Could you please provide more details for your scenario that is affected by MaxConnecting setting, as well as other pool settings and high concurrency characteristics, so we could better understand the need?&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                            <comment id="4093585" author="onyxmaster" created="Thu, 30 Sep 2021 08:38:40 +0000"  >&lt;p&gt;I do not think this should be a connection string-level parameter since it would practically invite people to set it incorrectly, but maybe add it to &lt;tt&gt;MongoDefaults&lt;/tt&gt; as a settable property?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="1890889">DRIVERS-1943</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                                                <inwardlinks description="is caused by">
                                        <issuelink>
            <issuekey id="1585342">CSHARP-3305</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="344279" name="image-2021-11-05-15-40-01-037.png" size="112314" author="alkampfer" created="Fri, 5 Nov 2021 14:40:01 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <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|hyevlb:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>