<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:11:50 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>[DOCS-15043] [Server] Investigate changes in SERVER-60412: Host memory limit check does not honor cgroups v2 </title>
                <link>https://jira.mongodb.org/browse/DOCS-15043</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>    &lt;div class=&quot;panel&quot; style=&quot;background-color: #c2d2c2;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;background-color: #239eb0;&quot;&gt;&lt;b&gt;Downstream Change Summary&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #c2d2c2;&quot;&gt;
&lt;p&gt;    Adds support for using cgroups v2 to specify the memory available to the environment running a mongo server (e.g., mongod). &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-16571&quot; title=&quot;Use Actual Memory Constraint vs. Total System Memory When They Differ&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-16571&quot;&gt;&lt;del&gt;SERVER-16571&lt;/del&gt;&lt;/a&gt; added support for cgroups v1, and this ticket extends that support for cgroups v2.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h2&gt;&lt;a name=&quot;DescriptionofLinkedTicket&quot;&gt;&lt;/a&gt;Description of Linked Ticket&lt;/h2&gt;
&lt;p&gt;    As I checked mongoDB gained support for memory constraints over cgroup in linux with &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-16571&quot; title=&quot;Use Actual Memory Constraint vs. Total System Memory When They Differ&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-16571&quot;&gt;&lt;del&gt;SERVER-16571&lt;/del&gt;&lt;/a&gt;. However it seems that it doesn&apos;t have the ability to check memory limit if host is using cgroups v2 resulting hostInfo.system.memLimitMB to be equal to system memory in a containerized environment.&lt;/p&gt;

&lt;p&gt;Current code to read memory limits in src/mongo/util/processinfo_linux.cpp&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: #008200; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;//&#160;LinuxSysHelper::getMemorySizeLimit().&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;.....&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;std::string cgmemlimit = readLineFromFile(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;/sys/fs/cgroup/memory/memory.limit_in_bytes&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;....&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;But in cgroups v2 the memory limit is at /sys/fs/cgroup/memory.max.&lt;/p&gt;

&lt;p&gt;I think engine should check if the cgroups v2 is enabled on the host and then read the limits according to that.&lt;/p&gt;

&lt;p&gt;Tested on mongodb 4.2.6 in docker containers at host Fedore CoreOS&#160;34.20210904.3.0. But I do believe newer versions have the same since source code seems same since first implementation.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
</description>
                <environment></environment>
        <key id="1966151">DOCS-15043</key>
            <summary>[Server] Investigate changes in SERVER-60412: Host memory limit check does not honor cgroups v2 </summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="kenneth.dyer@mongodb.com">Kenneth Dyer</assignee>
                                    <reporter username="backlog-server-pm">Backlog - Core Eng Program Management Team</reporter>
                        <labels>
                            <label>backlog</label>
                            <label>request</label>
                    </labels>
                <created>Tue, 18 Jan 2022 20:55:48 +0000</created>
                <updated>Wed, 7 Feb 2024 23:46:48 +0000</updated>
                            <resolved>Wed, 7 Feb 2024 23:46:48 +0000</resolved>
                                                    <fixVersion>5.3.0</fixVersion>
                    <fixVersion>4.4.14</fixVersion>
                    <fixVersion>4.2.20</fixVersion>
                    <fixVersion>5.0.7</fixVersion>
                                    <component>manual</component>
                    <component>Server</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="6077265" author="JIRAUSER1263037" created="Wed, 7 Feb 2024 23:46:48 +0000"  >&lt;p&gt;No changes required.&lt;/p&gt;</comment>
                            <comment id="6077261" author="amirsaman.memaripour" created="Wed, 7 Feb 2024 23:44:28 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kenneth.dyer%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;kenneth.dyer@mongodb.com&quot;&gt;kenneth.dyer@mongodb.com&lt;/a&gt;, that sounds good to me. We only added support to &lt;tt&gt;cgroupsv2&lt;/tt&gt;, so if there&apos;s no need to mention that, what we currently have is correct.&lt;/p&gt;</comment>
                            <comment id="4395604" author="JIRAUSER1257477" created="Mon, 7 Mar 2022 17:06:01 +0000"  >&lt;p&gt;&lt;em&gt;Fix Version updated for upstream &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60412&quot; title=&quot;Host memory limit check does not honor cgroups v2 &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60412&quot;&gt;&lt;del&gt;SERVER-60412&lt;/del&gt;&lt;/a&gt;:&lt;/em&gt; &lt;br/&gt;
5.3.0, 5.0.7, 4.4.14, 4.2.20&lt;/p&gt;</comment>
                            <comment id="4395198" author="JIRAUSER1257477" created="Mon, 7 Mar 2022 15:48:00 +0000"  >&lt;p&gt;&lt;em&gt;Fix Version updated for upstream &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60412&quot; title=&quot;Host memory limit check does not honor cgroups v2 &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60412&quot;&gt;&lt;del&gt;SERVER-60412&lt;/del&gt;&lt;/a&gt;:&lt;/em&gt; &lt;br/&gt;
5.3.0, 5.0.7, 4.4.14&lt;/p&gt;</comment>
                            <comment id="4395195" author="JIRAUSER1257477" created="Mon, 7 Mar 2022 15:47:52 +0000"  >&lt;p&gt;&lt;em&gt;Fix Version updated for upstream &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60412&quot; title=&quot;Host memory limit check does not honor cgroups v2 &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60412&quot;&gt;&lt;del&gt;SERVER-60412&lt;/del&gt;&lt;/a&gt;:&lt;/em&gt; &lt;br/&gt;
5.3.0, 4.4.14&lt;/p&gt;</comment>
                            <comment id="4298842" author="dbeng-pm-bot" created="Tue, 18 Jan 2022 20:55:51 +0000"  >&lt;p&gt;&lt;em&gt;Downstream changes updated for upstream &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60412&quot; title=&quot;Host memory limit check does not honor cgroups v2 &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60412&quot;&gt;&lt;del&gt;SERVER-60412&lt;/del&gt;&lt;/a&gt;:&lt;/em&gt; &lt;br/&gt;
Adds support for using cgroups v2 to specify the memory available to the environment running a mongo server (e.g., mongod). &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-16571&quot; title=&quot;Use Actual Memory Constraint vs. Total System Memory When They Differ&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-16571&quot;&gt;&lt;del&gt;SERVER-16571&lt;/del&gt;&lt;/a&gt; added support for cgroups v1, and this ticket extends that support for cgroups v2.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                        <issuelink>
            <issuekey id="1995831">DOCS-15152</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1995836">DOCS-15153</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                            <outwardlinks description="documents">
                                        <issuelink>
            <issuekey id="1888797">SERVER-60412</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1995993">DOCS-15155</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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 18 Jan 2022 20:55:51 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 hours, 25 minutes 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>DOCSP-19447</customfieldvalue>
                        </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>kenneth.dyer@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 hours ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>amirsaman.memaripour@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-pm</customfieldvalue>
            <customfieldvalue>jess.mokrzecki@mongodb.com</customfieldvalue>
            <customfieldvalue>kenneth.dyer@mongodb.com</customfieldvalue>
            <customfieldvalue>dbeng-pm-bot</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0h8nb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i00ckf:</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_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0gusn:</customfieldvalue>

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