<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:47: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>[SERVER-81784] Pass MSG_WAITALL to send/recv when doing sync networking</title>
                <link>https://jira.mongodb.org/browse/SERVER-81784</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;This tells the kernel not to bother waking user-space until the whole message has been sent/received. Without it, the kernel wakes us each time there is a partially complete send/recv just so that we can call send/recv again with an advanced buffer slice.  findOne latency for a 1MB document went from ~750&#956;s to ~550&#956;s, so that is a lot of wasted work.&lt;/p&gt;

&lt;p&gt;Unfortunately asio doesn&apos;t know to set it, so we will need to bypass asio and do it ourselves.&lt;/p&gt;

&lt;p&gt;While we are at it, we should make the &lt;tt&gt;sourceMessage&lt;/tt&gt; a bit more optimal for small messages as well. Currently we do a recv of 16 bytes to read the header, then do another recv to read the rest of the message. Instead we should allocate a buffer on the stack (maybe 1, 4, or 16KB?) and do a recv into that, only looping until we have the size (in general we won&apos;t loop at all). If we got lucky and got a full message on our first try, we can just copy that into a &lt;tt&gt;Message&lt;/tt&gt; and move on without doing a second syscall. If we didn&apos;t get a full message then we should to a &lt;tt&gt;recv(MSG_WAITALL)&lt;/tt&gt; for the remainder.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;sinkMessage&lt;/tt&gt; is simpler and we can just unconditionally use &lt;tt&gt;MSG_WAITALL&lt;/tt&gt; when sync because we always have a full message ready to go.&lt;/p&gt;

&lt;p&gt;Note, this will only show an improvement for large messages, with the impact proportional to the size of the message. So be sure to run benchmarks that involve very large messages.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2457129">SERVER-81784</key>
            <summary>Pass MSG_WAITALL to send/recv when doing sync networking</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="erin.mcnulty@mongodb.com">Erin McNulty</assignee>
                                    <reporter username="mathias@mongodb.com">Mathias Stearn</reporter>
                        <labels>
                            <label>perf-8.0</label>
                            <label>perf-tiger</label>
                            <label>perf-tiger-handoff</label>
                            <label>perf-tiger-poc</label>
                            <label>perf-tiger-q4</label>
                            <label>perf-tiger-triaged</label>
                    </labels>
                <created>Tue, 3 Oct 2023 11:11:38 +0000</created>
                <updated>Wed, 24 Jan 2024 22:54:24 +0000</updated>
                            <resolved>Mon, 20 Nov 2023 15:41:30 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="5892495" author="JIRAUSER1260475" created="Mon, 20 Nov 2023 15:41:31 +0000"  >&lt;p&gt;Discussed with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mathias%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;mathias@mongodb.com&quot;&gt;mathias@mongodb.com&lt;/a&gt; , MSG_WAITALL is not actually checked when passed in `send`, and the tasks of investigating it with `recv` and investigating the effects of MSG_ZEROCOPY have been split into their own tickets. We are still curious why his POC showed an improvement (my patches showed varying results, mostly unchanged perf on a non-tls variant from implementing this), but are closing this because this would be a non-TLS only improvement anyways, and so we decided it wasn&apos;t worth further investigation beyond what has already been done.&lt;/p&gt;</comment>
                            <comment id="5883478" author="JIRAUSER1260475" created="Wed, 15 Nov 2023 22:12:15 +0000"  >&lt;p&gt;Filed &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-83303&quot; title=&quot;Attempt to read whole message in one go in sourceMessage&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-83303&quot;&gt;SERVER-83303&lt;/a&gt; to address sourceMessage because of additional complications discovered for exhaust commands, and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-83304&quot; title=&quot;Investigate MSG_ZEROCOPY for large messages&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-83304&quot;&gt;SERVER-83304&lt;/a&gt; to investigate MSG_ZEROCOPY.&lt;/p&gt;</comment>
                            <comment id="5748575" author="redbeard0531" created="Tue, 3 Oct 2023 14:14:57 +0000"  >&lt;p&gt;Could also investigate using &lt;a href=&quot;https://www.kernel.org/doc/html/latest/networking/msg_zerocopy.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MSG_ZEROCOPY&lt;/a&gt; with large messages to keep the &lt;tt&gt;Message&lt;/tt&gt; object alive until the kernel knows it won&apos;t need it while allowing the kernel to avoid doing its own copies. They claim it is only beneficial for messages &amp;gt;10KB. (Let me know if I should file a separate ticket for this or if you want to look into it as part of this work)&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25132"><![CDATA[Service Arch]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 15 Nov 2023 22:12:15 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 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>sara.williamson@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>erin.mcnulty@mongodb.com</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2t3mf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2b0uc:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="7619">Service Arch 2023-11-13</customfieldvalue>
    <customfieldvalue id="7935">Service Arch 2023-11-27</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|i2sprr:</customfieldvalue>

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