<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:03 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-339] Send/Recieve buffer limits on mongod server/java driver communication</title>
                <link>https://jira.mongodb.org/browse/JAVA-339</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;We have setup MongoD instance in replica set mode and java driver in on application server in the same Data Center. (Second set of application servers in another datacenter)&lt;/p&gt;

&lt;p&gt;Our payload between server and client is around 300K.&lt;br/&gt;
With smaller payloads, around 25K, the time taken to transfer the data between app server and mongod is less than a milli second (Single pass between these two)&lt;/p&gt;

&lt;p&gt;With bigger payload (~300K) the client and server communication seems to be taking 16ms. The reason for this delay is due to multiple rounds of data transfer between them.&lt;br/&gt;
The time for lookup for different datacenter is around 300ms (due to multiple rounds of data transfer).&lt;/p&gt;

&lt;p&gt;In mysql, there is an option to increase the Send/Recieve buffer (So all the data is sent in one shot instead of waiting for the ACK from the client during the transfer everytime)&lt;/p&gt;

&lt;p&gt;Is there any such parameter available for MongoD ??&lt;/p&gt;

&lt;p&gt;Thanks &amp;amp; Regards&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;santhu&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Red Hat Linux</environment>
        <key id="16494">JAVA-339</key>
            <summary>Send/Recieve buffer limits on mongod server/java driver communication</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="-1">Unassigned</assignee>
                                    <reporter username="santhu.kumar">santosh kumar kancha</reporter>
                        <labels>
                    </labels>
                <created>Fri, 29 Apr 2011 18:39:56 +0000</created>
                <updated>Wed, 11 Sep 2019 19:12:47 +0000</updated>
                            <resolved>Sat, 10 Mar 2012 20:54:55 +0000</resolved>
                                    <version>2.4</version>
                                                    <component>Performance</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="97550" author="jeff.yemin" created="Sat, 10 Mar 2012 20:54:55 +0000"  >&lt;p&gt;Please re-open if you have any more feedback.&lt;/p&gt;</comment>
                            <comment id="73446" author="jeff.yemin" created="Thu, 15 Dec 2011 19:13:44 +0000"  >&lt;p&gt;Hi Santosh,&lt;/p&gt;

&lt;p&gt;Are we good to close this?  Haven&apos;t heard back from you since Antoine&apos;s last comment.&lt;/p&gt;</comment>
                            <comment id="30685" author="antoine" created="Mon, 2 May 2011 20:23:55 +0000"  >&lt;p&gt;I dont know how to set it on windows, smthing tells me it&apos;s not as easy as linux.&lt;br/&gt;
If you can, try running the client on a linux box too, since the java code is portable.&lt;/p&gt;

&lt;p&gt;Often times setting this value higher will not speed up transfer much.&lt;br/&gt;
The connection speed is usually more  limited by the size of the tcp congestion window.&lt;br/&gt;
That is why you should try to do several transfers in a row on same connection to see real speed.&lt;br/&gt;
Try doing a requestStart() then doing the request several times and see if it gets faster.&lt;/p&gt;

&lt;p&gt;There are different settings to try to get congestion window higher:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;use different congestion algos (tcp_congestion_control)&lt;/li&gt;
	&lt;li&gt;some OS let you bump up the initial congestion window&lt;/li&gt;
	&lt;li&gt;the congestion window tends to drop on idle connection (turn off tcp_slow_start_after_idle)&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="30667" author="santhu.kumar" created="Mon, 2 May 2011 18:46:57 +0000"  >&lt;p&gt;Hi Antoine,&lt;/p&gt;

&lt;p&gt;Thanks for the comment.&lt;br/&gt;
I will try this on the server machine.&lt;br/&gt;
My Java Client is running on Windows though. &lt;br/&gt;
Is there anything i should be setting up on windows for this ?&lt;/p&gt;

&lt;p&gt;Thanks &amp;amp; Regards&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;santosh&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="30665" author="antoine" created="Mon, 2 May 2011 18:42:52 +0000"  >&lt;p&gt;Hi Santosh,&lt;br/&gt;
Most recent OS are very smart about socket buffer sizes.&lt;br/&gt;
On linux typically it will start with medium size then grow as needed (up to 4MB on linux).&lt;br/&gt;
$ cat /proc/sys/net/ipv4/tcp_rmem &lt;br/&gt;
4096	87380	4194304&lt;/p&gt;

&lt;p&gt;You can set the buffer limits higher using some OS commands like&lt;br/&gt;
$ echo &quot;87380 4194304 8388608&quot; | sudo tee /proc/sys/net/ipv4/tcp_rmem&lt;/p&gt;

&lt;p&gt;You would need to set it higher on both client and server side for both wmem and rmem.&lt;br/&gt;
Could you try it and see if you get better performance, in which case we can push for this new option?&lt;br/&gt;
thanks&lt;/p&gt;</comment>
                            <comment id="30394" author="scotthernandez" created="Fri, 29 Apr 2011 22:57:30 +0000"  >&lt;p&gt;The server will respond with a single packet (within your network&apos;s limits) unless you have specified a smaller batchSize. By default the server will return 4/16MB of data for a batch (in a query). Are you using a limit in your find?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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|hrhc6f:</customfieldvalue>

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