<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:55:54 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-20991] WiredTiger caching strategy needs improvement on Windows</title>
                <link>https://jira.mongodb.org/browse/SERVER-20991</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When deploying MongoDb with WT on Windows OSs, physical memory is exhausted by file system caching, irrespective of WiredTigerCacheSizeGB. This makes it impossible to limit the amount of physical memory used by MongoDb, which means it cannot be deployed alongside other processes on the same physical hardware.&lt;/p&gt;

&lt;p&gt;The file system cache dedicated to WT I/O does not appear to be released under memory stress, and other processes may be starved for memory.&lt;/p&gt;

&lt;p&gt;Once the file system cache has consumed the majority of physical memory, idling MongoDb has no effect on releasing file system memory. The only way to reclaim the file system memory is to restart MongoDb.&lt;/p&gt;

&lt;p&gt;This effectively makes MongoDb with WT unusable as an embedded database - an area I think that MongoDb (the company) underestimates.&lt;/p&gt;</description>
                <environment></environment>
        <key id="234885">SERVER-20991</key>
            <summary>WiredTiger caching strategy needs improvement on Windows</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="9">Done</resolution>
                                        <assignee username="mark.benvenuto@mongodb.com">Mark Benvenuto</assignee>
                                    <reporter username="nick@innsenroute.com">Nick Judson</reporter>
                        <labels>
                    </labels>
                <created>Sat, 17 Oct 2015 16:41:48 +0000</created>
                <updated>Tue, 6 Jun 2017 19:56:46 +0000</updated>
                            <resolved>Thu, 12 Nov 2015 17:02:50 +0000</resolved>
                                                    <fixVersion>3.2.0-rc3</fixVersion>
                                    <component>Storage</component>
                    <component>WiredTiger</component>
                                        <votes>1</votes>
                                    <watches>18</watches>
                                                                                                                <comments>
                            <comment id="1414074" author="mark.benvenuto" created="Thu, 20 Oct 2016 19:18:03 +0000"  >&lt;p&gt;The KB article that talks about the issue for Windows 2008 R2. It appears to repro with MongoDB and YCSB on Windows 2012 R2 for me.&lt;br/&gt;
&lt;a href=&quot;https://support.microsoft.com/en-us/kb/976618&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://support.microsoft.com/en-us/kb/976618&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://blogs.msdn.microsoft.com/ntdebugging/2007/11/27/too-much-cache/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://blogs.msdn.microsoft.com/ntdebugging/2007/11/27/too-much-cache/&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://blogs.msdn.microsoft.com/ntdebugging/2009/02/06/microsoft-windows-dynamic-cache-service/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://blogs.msdn.microsoft.com/ntdebugging/2009/02/06/microsoft-windows-dynamic-cache-service/&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://blogs.technet.microsoft.com/yongrhee/2010/02/16/windows-7-and-windows-server-2008-r2-do-you-still-need-the-microsoft-windows-dynamic-cache-service/#3477119&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://blogs.technet.microsoft.com/yongrhee/2010/02/16/windows-7-and-windows-server-2008-r2-do-you-still-need-the-microsoft-windows-dynamic-cache-service/#3477119&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is a powershell script that will automatically adjust the cache size:&lt;br/&gt;
&lt;a href=&quot;http://serverfault.com/questions/325277/windows-server-2008-r2-metafile-ram-usage/527466#527466&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://serverfault.com/questions/325277/windows-server-2008-r2-metafile-ram-usage/527466#527466&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1115627" author="dan@10gen.com" created="Wed, 16 Dec 2015 00:58:16 +0000"  >&lt;p&gt;See &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21792&quot; title=&quot;Performance regression with directio enabled on Windows with WiredTiger&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21792&quot;&gt;&lt;del&gt;SERVER-21792&lt;/del&gt;&lt;/a&gt;.  You can still use this approach for workloads which it improves, but we need to go back to the drawing board for the general solution.&lt;/p&gt;</comment>
                            <comment id="1115625" author="mark.benvenuto" created="Wed, 16 Dec 2015 00:56:59 +0000"  >&lt;p&gt;To get the old behavior after the revert, use &lt;tt&gt;--wiredTigerEngineConfigString=&quot;direct_io=(data)&quot;&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;It was reverted after investigating this ticket: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21792&quot; title=&quot;Performance regression with directio enabled on Windows with WiredTiger&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21792&quot;&gt;&lt;del&gt;SERVER-21792&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1115613" author="nick@innsenroute.com" created="Wed, 16 Dec 2015 00:39:58 +0000"  >&lt;p&gt;Why was it reverted?&lt;/p&gt;</comment>
                            <comment id="1115579" author="mark.benvenuto" created="Wed, 16 Dec 2015 00:08:20 +0000"  >&lt;p&gt;The reverts were made against 3.2.1 and 3.3.0. They original fix change shipped in the release 3.2.0-rc3 up and including 3.2.0. It was reverted in 3.2.1 &amp;amp; 3.3.0.&lt;/p&gt;</comment>
                            <comment id="1115566" author="xgen-internal-githook" created="Tue, 15 Dec 2015 23:57:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;markbenvenuto&apos;, u&apos;name&apos;: u&apos;Mark Benvenuto&apos;, u&apos;email&apos;: u&apos;mark.benvenuto@mongodb.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20991&quot; title=&quot;WiredTiger caching strategy needs improvement on Windows&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20991&quot;&gt;&lt;del&gt;SERVER-20991&lt;/del&gt;&lt;/a&gt; Change WiredTiger caching strategy on Windows&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 884644ac56de2edc2223b75ceabe9e1a6fef6dab.&lt;br/&gt;
Branch: v3.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c7b065227470a27c40c45f07a8c967b7aa7af9db&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c7b065227470a27c40c45f07a8c967b7aa7af9db&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1115564" author="xgen-internal-githook" created="Tue, 15 Dec 2015 23:57:24 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;markbenvenuto&apos;, u&apos;name&apos;: u&apos;Mark Benvenuto&apos;, u&apos;email&apos;: u&apos;mark.benvenuto@mongodb.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20991&quot; title=&quot;WiredTiger caching strategy needs improvement on Windows&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20991&quot;&gt;&lt;del&gt;SERVER-20991&lt;/del&gt;&lt;/a&gt; Change WiredTiger caching strategy on Windows&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 884644ac56de2edc2223b75ceabe9e1a6fef6dab.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/439a56d7af3ce4bad983f5829b3485bb0af7f6c3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/439a56d7af3ce4bad983f5829b3485bb0af7f6c3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1086787" author="xgen-internal-githook" created="Thu, 12 Nov 2015 16:15:01 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;markbenvenuto&apos;, u&apos;name&apos;: u&apos;Mark Benvenuto&apos;, u&apos;email&apos;: u&apos;mark.benvenuto@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20991&quot; title=&quot;WiredTiger caching strategy needs improvement on Windows&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20991&quot;&gt;&lt;del&gt;SERVER-20991&lt;/del&gt;&lt;/a&gt; Change WiredTiger caching strategy on Windows&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/884644ac56de2edc2223b75ceabe9e1a6fef6dab&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/884644ac56de2edc2223b75ceabe9e1a6fef6dab&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1082578" author="nick@innsenroute.com" created="Sat, 7 Nov 2015 21:01:21 +0000"  >&lt;p&gt;I&apos;ve confirmed with mark that his initial build appears to solve the problem. Thanks for the update.&lt;/p&gt;</comment>
                            <comment id="1082555" author="dan@10gen.com" created="Sat, 7 Nov 2015 20:06:35 +0000"  >&lt;p&gt;Hi Nick, we&apos;re still ironing out some issues in code review.  We&apos;ll make a build available next week for test.&lt;/p&gt;</comment>
                            <comment id="1077458" author="nick@innsenroute.com" created="Mon, 2 Nov 2015 23:12:11 +0000"  >&lt;p&gt;Mark - is it possible to get copies of these different builds to load test? I don&apos;t have a machine that will build Mongo/WT.&lt;/p&gt;</comment>
                            <comment id="1077410" author="mark.benvenuto" created="Mon, 2 Nov 2015 22:40:16 +0000"  >&lt;p&gt;I ran the same tests to compare buffering vs &lt;tt&gt;FILE_FLAG_WRITE_THROUGH&lt;/tt&gt; without &lt;tt&gt;FILE_FLAG_NO_BUFFERING&lt;/tt&gt;. I ran these tests on a different machine then the first example, and saw very different I/O performance as compared to the first host.&lt;/p&gt;

&lt;p&gt;In this case, I do not see a performance difference between buffering, and &lt;tt&gt;FILE_FLAG_WRITE_THROUGH&lt;/tt&gt;. Note that system cache still buffers writes, and such 100% of the machine is in use.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;ins&gt;Test Machine:&lt;/ins&gt;&lt;/b&gt;&lt;br/&gt;
c3.2xlarge - 2x80 GB SSD disk - RAID 1, 15 GB RAM, 8 CPU&lt;br/&gt;
Git Hash# 08bcdca185912cf9f8c6c6bf7faa94b23ea76583 (~3.2.0rc1)&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;ins&gt;Test Case:&lt;/ins&gt;&lt;/b&gt;&lt;br/&gt;
YCSB - 8 threads load, 24 thread run&lt;/p&gt;

&lt;p&gt;&lt;ins&gt;Workload 1&lt;/ins&gt;:&lt;br/&gt;
5000000 Records&lt;br/&gt;
10000000 Operations &lt;br/&gt;
10 fields, each 100 bytes, zipfian request distribution&lt;br/&gt;
50% Read, 50% Update&lt;/p&gt;

&lt;p&gt;&lt;ins&gt;Load Phase&lt;/ins&gt; (Insert Only)&lt;/p&gt;
&lt;div class=&apos;table-wrap&apos;&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;CreateFile Buffering&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;WT Cache Size (GB)&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Run 1 - Duration(seconds)&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Run 2 - Duration(seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Buffered&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;160&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;FILE_FLAG_WRITE_THROUGH&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;166&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;169&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;&lt;ins&gt;Run Phase&lt;/ins&gt; (50% Read, 50% Update)&lt;/p&gt;
&lt;div class=&apos;table-wrap&apos;&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;CreateFile Buffering&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;WT Cache Size (GB)&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Run 1 - Duration(seconds)&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Run 2 - Duration(seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Buffered&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;528&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;FILE_FLAG_WRITE_THROUGH&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;505&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;504&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</comment>
                            <comment id="1075950" author="nick@innsenroute.com" created="Sat, 31 Oct 2015 01:07:05 +0000"  >&lt;p&gt;Looks like a solid 15% perf improvement. I assume this also stops Windows from loading the .wt files into the system buffer cache?&lt;/p&gt;</comment>
                            <comment id="1075674" author="mark.benvenuto" created="Fri, 30 Oct 2015 19:21:14 +0000"  >&lt;p&gt;I have investigated the performance with YCSB in three scenarios (load, 50/50, 50/45/5) on AWS with three variations. In short, we can address most of the issues by enabling &lt;tt&gt;FILE_FLAG_NO_BUFFERING&lt;/tt&gt; as the default in WiredTiger. This has better performance then using Direct I/O or the normal buffering because the Windows will not page out &lt;tt&gt;mongod.exe&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Variations&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Normal = Default MongoDB&lt;/li&gt;
	&lt;li&gt;Non-Buffered =  &lt;tt&gt;FILE_FLAG_NO_BUFFERING&lt;/tt&gt; for data files&lt;br/&gt;
#Direct_IO = &lt;tt&gt;FILE_FLAG_NO_BUFFERING&lt;/tt&gt; &amp;amp;&amp;amp; &lt;tt&gt;FILE_FLAG_WRITE_THROUGH&lt;/tt&gt; for data files&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;b&gt;&lt;ins&gt;Test Machine:&lt;/ins&gt;&lt;/b&gt;&lt;br/&gt;
c3.2xlarge - 2x80 GB SSD disk - RAID 1, 15 GB RAM, 8 CPU&lt;br/&gt;
Git Hash# 08bcdca185912cf9f8c6c6bf7faa94b23ea76583 (~3.2.0rc1)&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;ins&gt;Test Case:&lt;/ins&gt;&lt;/b&gt;&lt;br/&gt;
YCSB - 8 threads load, 24 thread run&lt;/p&gt;

&lt;p&gt;&lt;ins&gt;Workload 1&lt;/ins&gt;:&lt;br/&gt;
5000000 Records&lt;br/&gt;
10000000 Operations &lt;br/&gt;
10 fields, each 100 bytes, zipfian request distribution&lt;br/&gt;
50% Read, 50% Update&lt;/p&gt;

&lt;p&gt;&lt;ins&gt;Load Phase&lt;/ins&gt; (Insert Only)&lt;/p&gt;
&lt;div class=&apos;table-wrap&apos;&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;CreateFile Buffering&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;WT Cache Size (GB)&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Run 1 - Duration(seconds)&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Run 2 - Duration(seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Buffered&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;318&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;321&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Non-Buffered&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;311&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;311&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Direct_IO&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;312&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;314&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;&lt;ins&gt;Run Phase&lt;/ins&gt; (50% Read, 50% Update)&lt;/p&gt;
&lt;div class=&apos;table-wrap&apos;&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;CreateFile Buffering&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;WT Cache Size (GB)&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Run 1 - Duration(seconds)&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Run 2 - Duration(seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Buffered&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;847&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;839&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Non-Buffered&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;708&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;711&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Direct_IO&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;769&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;766&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;&lt;ins&gt;Workload 2&lt;/ins&gt;:&lt;br/&gt;
5000000 Records&lt;br/&gt;
10000000 Operations &lt;br/&gt;
10 fields, each 100 bytes, zipfian request distribution&lt;br/&gt;
50% Read, 45% Update, 5% Insert&lt;/p&gt;

&lt;p&gt;&lt;ins&gt;Run Phase&lt;/ins&gt; (50% Read, 45% Update, 5% Insert)&lt;/p&gt;
&lt;div class=&apos;table-wrap&apos;&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;CreateFile Buffering&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;WT Cache Size (GB)&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Run 1 - Duration(seconds)&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Run 2 - Duration(seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Buffered&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;900&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;905&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Non-Buffered&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;816&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;740&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Direct_IO&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;878&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;874&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;&lt;ins&gt;POC Patch:&lt;/ins&gt;&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: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;diff --git a/src/third_party/wiredtiger/SConscript b/src/third_party/wiredtiger/SConscript&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;index 29ffc58..b83951f 100644&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;--- a/src/third_party/wiredtiger/SConscript&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;+++ b/src/third_party/wiredtiger/SConscript&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;@@ -38,6 +39,7 @@ if env.TargetOSIs(&apos;windows&apos;):&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;     if get_option(&apos;allocator&apos;) == &apos;tcmalloc&apos;:&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;         env.InjectThirdPartyIncludePaths(libraries=[&apos;gperftools&apos;])&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;+        env.Append(CPPDEFINES=[&apos;HAVE_POSIX_MEMALIGN&apos;])&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;         env.Append(CPPDEFINES=[&apos;HAVE_LIBTCMALLOC&apos;])&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; elif env.TargetOSIs(&apos;osx&apos;):&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;     env.Append(CPPPATH=[&quot;build_darwin&quot;])&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;diff --git a/src/third_party/wiredtiger/src/os_win/os_open.c b/src/third_party/wiredtiger/src/os_win/os_open.c&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;index c7b3040..143fb3a 100644&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;--- a/src/third_party/wiredtiger/src/os_win/os_open.c&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;+++ b/src/third_party/wiredtiger/src/os_win/os_open.c&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;@@ -91,7 +91,7 @@ __wt_open(WT_SESSION_IMPL *session,&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;        /* Disable read-ahead on trees: it slows down random read workloads. */&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;        if (dio_type == WT_FILE_TYPE_DATA ||&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;            dio_type == WT_FILE_TYPE_CHECKPOINT)&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;-               f |= FILE_FLAG_RANDOM_ACCESS;&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;+               f |= FILE_FLAG_RANDOM_ACCESS | FILE_FLAG_NO_BUFFERING;&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;&amp;nbsp;&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;        filehandle = CreateFileA(path,&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;                                (GENERIC_READ | GENERIC_WRITE),&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="1070132" author="michael.cahill" created="Mon, 26 Oct 2015 04:40:54 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nick%40innsenroute.com&quot; class=&quot;user-hover&quot; rel=&quot;nick@innsenroute.com&quot;&gt;nick@innsenroute.com&lt;/a&gt;, MongoDB does not currently make any use of the mmap feature in WiredTiger, and it would be quite difficult to change that in any general purpose way, since access must be read-only.  I am hopeful that the impact of direct I/O on reads will be less pronounced without &lt;tt&gt;FILE_FLAG_NO_BUFFERING&lt;/tt&gt; but we&apos;ll have to wait until we run some tests to find out.&lt;/p&gt;</comment>
                            <comment id="1070114" author="nick@innsenroute.com" created="Mon, 26 Oct 2015 03:57:08 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=Michael+Cahill&quot; class=&quot;user-hover&quot; rel=&quot;Michael Cahill&quot;&gt;Michael Cahill&lt;/a&gt; - I don&apos;t see any write performance hit on the three drives I tested: SSD, 7.2K, and a sad USB external (5.4K I think). Read performance suffers big time. Is it possible to try out read-only (capped) mmap for read cache?&lt;/p&gt;

&lt;p&gt;Since my implementation is a message queue, I like that the data I&apos;ve just written is part of the WT cache, as it get&apos;s read back out very quickly. After it&apos;s been read though, I very rarely ever need it again.&lt;/p&gt;</comment>
                            <comment id="1070087" author="michael.cahill" created="Mon, 26 Oct 2015 02:24:05 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alessandro.gherardi%40schneider-electric.com&quot; class=&quot;user-hover&quot; rel=&quot;alessandro.gherardi@schneider-electric.com&quot;&gt;alessandro.gherardi@schneider-electric.com&lt;/a&gt;, my hope is that avoiding filesystem cache with &lt;tt&gt;FILE_FLAG_WRITE_THROUGH&lt;/tt&gt; will alleviate the issue reported here without the performance degradation that can result from &lt;tt&gt;FILE_FLAG_NO_BUFFERING&lt;/tt&gt; (which is highly dependent on the speed of the underlying volume).&lt;/p&gt;

&lt;p&gt;All I am suggesting at this point is that we will investigate the performance implications: any discussion about how this would be configured will only happen once there is demonstration of a benefit.&lt;/p&gt;</comment>
                            <comment id="1070084" author="alessandro.gherardi@schneider-electric.com" created="Mon, 26 Oct 2015 02:14:07 +0000"  >&lt;p&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; For the record, setting &quot;mmap=false&quot; will have no effect &lt;br/&gt;
Thanks for clarifying.&lt;/p&gt;

&lt;p&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; We will investigate a mode that allows FILE_FLAG_WRITE_THROUGH without FILE_FLAG_NO_BUFFERING&lt;br/&gt;
Since the goal of this ticket is to cap the amount of physical memory used by MongoDb, can you please explain why one would want FILE_FLAG_WRITE_THROUGH without FILE_FLAG_NO_BUFFERING?&lt;/p&gt;

&lt;p&gt;Per &lt;a href=&quot;https://support.microsoft.com/en-us/kb/99794&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://support.microsoft.com/en-us/kb/99794&lt;/a&gt;, FILE_FLAG_WRITE_THROUGH still causes data to be stored in the disk cache.&lt;/p&gt;

&lt;p&gt;Is your intent to allow MongoDB administrators to configure FILE_FLAG_WRITE_THROUGH and FILE_FLAG_NO_BUFFERING via 2 separate WT options, so that MongoDB administrator have more control on how WT behaves?&lt;/p&gt;</comment>
                            <comment id="1070064" author="michael.cahill" created="Mon, 26 Oct 2015 01:22:09 +0000"  >&lt;p&gt;For the record, setting &quot;mmap=false&quot; will have no effect on MongoDB runs with the default btree access method in WiredTiger.  The &quot;mmap&quot; setting only applies to read-only access to WiredTiger checkpoints, which MongoDB does not currently use.&lt;/p&gt;

&lt;p&gt;We will investigate a mode that allows &lt;tt&gt;FILE_FLAG_WRITE_THROUGH&lt;/tt&gt; without &lt;tt&gt;FILE_FLAG_NO_BUFFERING&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="1069831" author="nick@innsenroute.com" created="Sun, 25 Oct 2015 03:52:15 +0000"  >&lt;p&gt;&lt;a href=&quot;http://source.wiredtiger.com/develop/tuning.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://source.wiredtiger.com/develop/tuning.html&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Many Linux systems do not support mixing O_DIRECT and memory mapping or normal I/O to the same file, and attempting to do so can result in data loss or corruption. For this reason:&lt;br/&gt;
&#8226;WiredTiger silently ignores the setting of the mmap configuration to the wiredtiger_open function in those cases, and will never memory map a file which is configured for direct I/O&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I think setting direct_io=&lt;span class=&quot;error&quot;&gt;&amp;#91;data&amp;#93;&lt;/span&gt; is equivalent to direct_io=&lt;span class=&quot;error&quot;&gt;&amp;#91;data&amp;#93;&lt;/span&gt; AND mmap=false.&lt;/p&gt;

&lt;p&gt;I don&apos;t know how the WT cache operates vs the file system cache, so I can&apos;t comment on what makes the most sense. I actually think mmapping would be ok if it&apos;s for read-only usage and is capped by WT (again I&apos;m no expert here but I suspect the view on the file(s) can be configured to be a specific size). Direct_IO seems to be great for heavy writing (on Windows), but we definitely want some read cache somewhere.&lt;/p&gt;
</comment>
                            <comment id="1069826" author="alessandro.gherardi@schneider-electric.com" created="Sun, 25 Oct 2015 01:13:17 +0000"  >&lt;p&gt;Hi Nick,&lt;br/&gt;
Thanks for your reply.&lt;/p&gt;

&lt;p&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I ran my test using that option (which is not compatible with direct_io)&lt;br/&gt;
Where in the documentation did you find out that mmap=false is not compatible with direct_io?&lt;/p&gt;

&lt;p&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and the system cache still fills up&lt;br/&gt;
That makes sense. If one sets mmap=false WITHOUT also setting direct_io, Windows uses the system cache, and that ends up consuming all available RAM.&lt;/p&gt;

&lt;p&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I&apos;m still thinking &apos;write_through&apos; plus a read-only cache (WT or MMap) would be ideal.&lt;br/&gt;
I&apos;m concerned that, if WT is allowed to use memory-mapped files (i.e., mmap=true), WT can end up consuming RAM in an unchecked fashion. In other words, it&apos;s not any better than the MMAPv1 storage engine in terms of hogging up RAM. With mmap=false instead, WT uses its cache whose size is capped via wiredTigerCacheSizeGB .&lt;/p&gt;

&lt;p&gt;In other words, for the purpose of capping the RAM used by WT, it seems to me that specifying BOTH mmap=false AND direct_io=&lt;span class=&quot;error&quot;&gt;&amp;#91;data&amp;#93;&lt;/span&gt; is the best option.&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;</comment>
                            <comment id="1069813" author="nick@innsenroute.com" created="Sat, 24 Oct 2015 23:35:12 +0000"  >&lt;p&gt;Alessandro. No I don&apos;t. I ran my test using that option (which is not compatible with direct_io) and the system cache still fills up (although perhaps not quite as quickly). On my workload it appears to be roughly equal in speed to direct_io, although queries do run much faster once they&apos;ve been hit once and loaded into cache.&lt;/p&gt;

&lt;p&gt;I&apos;m still thinking &apos;write_through&apos; plus a read-only cache (WT or MMap) would be ideal.&lt;/p&gt;</comment>
                            <comment id="1069729" author="alessandro.gherardi@schneider-electric.com" created="Sat, 24 Oct 2015 14:46:22 +0000"  >&lt;p&gt;Hi Nick,&lt;br/&gt;
When you run your workload test, do you also set: wiredTigerEngineConfigString = mmap=false in the mongoD configuration file?&lt;/p&gt;

&lt;p&gt;Without mmap=false, WT uses memory-mapped files rather than the WT cache for reads. That defeats the purpose of trying to cap the RAM that mongoD uses via the wiredTigerCacheSizeGB option. I&apos;m actually wondering if wiredTigerCacheSizeGB is completely useless unless one also sets mmap=false.&lt;/p&gt;

&lt;p&gt;Thoughts?&lt;/p&gt;</comment>
                            <comment id="1067099" author="nick@innsenroute.com" created="Wed, 21 Oct 2015 18:02:47 +0000"  >&lt;p&gt;Would it be possible to have writes be direct to disk (direct_io) but reads be loaded into the cache - either WT or OS? The write data could go into the cache, but it wouldn&apos;t get flushed to disk (writes would be direct). Having a read-only cache might solve the problem of large/constant flushes and also allow for fast queries.&lt;/p&gt;</comment>
                            <comment id="1063850" author="nick@innsenroute.com" created="Mon, 19 Oct 2015 03:37:38 +0000"  >&lt;p&gt;&lt;a href=&quot;http://winntfs.com/2012/11/29/windows-write-caching-part-2-an-overview-for-application-developers/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://winntfs.com/2012/11/29/windows-write-caching-part-2-an-overview-for-application-developers/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apparently SQL Server uses direct IO (MS SQL is what my product currently uses).&lt;/p&gt;

&lt;p&gt;Also, if I understand correctly, a large WT cache will hamper write speed (which is what I see in my tests), but obviously it&apos;s beneficial when reading the data. &lt;b&gt;If&lt;/b&gt; the WT cache doesn&apos;t contain the data to be read, a read request is passed to the IO subsystem. The system file cache (if used), may have the required data in memory in which case no disk IO is required. WT stores uncompressed data in its cache whereas the OS will be storing compressed bytes.&lt;/p&gt;

&lt;p&gt;Is it likely that there will be a significant overlap in what WT has cached and what the OS has cached - essentially double-buffering data (both uncompressed and compressed)? If that is the case, does it make sense to max out the RAM with WT cache and use direct_IO?&lt;/p&gt;

&lt;p&gt;For write-heavy workloads like mine, the following paragraph may explain why a large WT/system file cache can hurt performance:&lt;/p&gt;

&lt;p&gt;...&quot;Liberal use of the FlushFileBuffers API can severely affect system throughput. This is because at the file system layer, it is quite clear what data blocks belong to what file. So when FlushFileBuffers is invoked, it is also apparent what data buffers need to be written out to media. However, at the block storage layer &#8211; shown as &#8220;Sector I/O&#8221; in Figure 1, it is difficult to track what blocks are associated with what files. Consequently the only way to honor any FlushFileBuffers call is to make sure all data is flushed to media. Therefore, not only is more data written out than originally intended, but the larger amount of data can affect other I/O optimizations such as queuing of the writes.&quot;&lt;/p&gt;</comment>
                            <comment id="1063828" author="nick@innsenroute.com" created="Mon, 19 Oct 2015 02:35:13 +0000"  >&lt;p&gt;Testing against my workload, I get better performance with direct IO on both SSD and 7.2K spinners, with memory usage capped at the WT cache size. I haven&apos;t run a full spectrum of tests, but so far (with my workload) I&apos;m not sure what the downside of direct IO is.&lt;/p&gt;</comment>
                            <comment id="1063598" author="nick@innsenroute.com" created="Sat, 17 Oct 2015 16:44:27 +0000"  >&lt;p&gt;This ticket (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-19795&quot; title=&quot;mongod memory consumption higher than WT cache size (at least on Windows 2008 R2)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-19795&quot;&gt;&lt;del&gt;SERVER-19795&lt;/del&gt;&lt;/a&gt;) illustrates the file system buffering consuming all the physical RAM.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="238077">WT-2200</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="238379">SERVER-21349</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="390768">SERVER-29465</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="224389">SERVER-19795</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="214726">WT-1990</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>27.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 21 Oct 2015 01:22:32 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 16 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/WT-2200'>WT-2200</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-21349'>SERVER-21349</a></s>]]></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>alexander.gorrod@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 16 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[Windows]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>alessandro.gherardi@schneider-electric.com</customfieldvalue>
            <customfieldvalue>dan@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>mark.benvenuto@mongodb.com</customfieldvalue>
            <customfieldvalue>michael.cahill@mongodb.com</customfieldvalue>
            <customfieldvalue>nick@innsenroute.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrkrhz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hre0mn:</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_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="723">Platform C (11/20/15)</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;Run MongoDb with WT (tested on 3.1.8 and 3.2RC0) on Windows with a cache size significantly less than physical RAM. Run an insert-heavy workload (I can provide one).&lt;/p&gt;</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_11861" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>User Summary</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11856"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hsfjyn:</customfieldvalue>

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