<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:21:21 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-9754] Every write to journal costs additional seek to update file metadata</title>
                <link>https://jira.mongodb.org/browse/SERVER-9754</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Journal file is created with FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH attributes, but FILE_FLAG_WRITE_THROUGH is not needed here and even worse it flushes NTFS metadata on every write operation. Removing it doesn&apos;t affect durability (FILE_FLAG_NO_BUFFERING does it&apos;s job), but greatly improves performance and reduces disk load.&lt;/p&gt;

&lt;p&gt;You can read detailed explanation here &lt;a href=&quot;http://dmitry-naumov.blogspot.ru/2013/05/mongodb-vs-ms-sql-how-to-write-to.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://dmitry-naumov.blogspot.ru/2013/05/mongodb-vs-ms-sql-how-to-write-to.html&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Windows 7 Professional x64 SP1</environment>
        <key id="76192">SERVER-9754</key>
            <summary>Every write to journal costs additional seek to update file metadata</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="9">Done</resolution>
                                        <assignee username="tad">Tad Marshall</assignee>
                                    <reporter username="dnaumov">Dmitry Naumov</reporter>
                        <labels>
                            <label>pull-request</label>
                    </labels>
                <created>Wed, 22 May 2013 12:28:54 +0000</created>
                <updated>Mon, 11 Jul 2016 17:38:13 +0000</updated>
                            <resolved>Wed, 5 Jun 2013 06:28:37 +0000</resolved>
                                    <version>2.4.3</version>
                                    <fixVersion>2.4.6</fixVersion>
                    <fixVersion>2.5.1</fixVersion>
                                    <component>Performance</component>
                                        <votes>0</votes>
                                    <watches>11</watches>
                                                                                                                <comments>
                            <comment id="391150" author="auto" created="Mon, 29 Jul 2013 18:33:55 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;DmitryNaumov&apos;, u&apos;name&apos;: u&apos;Dmitry Naumov&apos;, u&apos;email&apos;: u&apos;dnaumov@paladyne.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9754&quot; title=&quot;Every write to journal costs additional seek to update file metadata&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9754&quot;&gt;&lt;del&gt;SERVER-9754&lt;/del&gt;&lt;/a&gt; Remove FILE_FLAG_WRITE_THROUGH for journal files&lt;/p&gt;

&lt;p&gt;Signed-off-by: Tad Marshall &amp;lt;tad@10gen.com&amp;gt;&lt;br/&gt;
Branch: v2.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/896ad48104be797f76dd8e65d18ff21a7be34d38&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/896ad48104be797f76dd8e65d18ff21a7be34d38&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="353328" author="dnaumov" created="Wed, 5 Jun 2013 07:04:11 +0000"  >&lt;p&gt;I hope those unlucky who don&apos;t have RAID-0 will get larger profit from it.&lt;/p&gt;</comment>
                            <comment id="353313" author="tad" created="Wed, 5 Jun 2013 06:28:37 +0000"  >&lt;p&gt;Suggest backport to 2.4 and 2.2.&lt;/p&gt;</comment>
                            <comment id="353312" author="auto" created="Wed, 5 Jun 2013 06:26:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;DmitryNaumov&apos;, u&apos;name&apos;: u&apos;Dmitry Naumov&apos;, u&apos;email&apos;: u&apos;dnaumov@paladyne.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9754&quot; title=&quot;Every write to journal costs additional seek to update file metadata&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9754&quot;&gt;&lt;del&gt;SERVER-9754&lt;/del&gt;&lt;/a&gt; Remove FILE_FLAG_WRITE_THROUGH for journal files&lt;/p&gt;

&lt;p&gt;Signed-off-by: Tad Marshall &amp;lt;tad@10gen.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/54e11a3cfa5de27351da1c9c55d539b3b17a0b00&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/54e11a3cfa5de27351da1c9c55d539b3b17a0b00&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="353310" author="tad" created="Wed, 5 Jun 2013 06:25:21 +0000"  >&lt;p&gt;I ran a subset of the cases in your test and verified the performance improvement you saw.  I ran mongod.exe with --journalCommitInterval 2 and --syncdelay 10000, without and with your patch:&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;// no patch&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;|Threads|Document Size|Elapsed|&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;|      1|         1718|  11749|&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;|      1|         4418|  11806|&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;|      2|         1718|  11711|&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;|      2|         4418|  12045|&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;|      4|         1718|  12116|&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;|      4|         4418|  12384|&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;// patch&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;|Threads|Document Size|Elapsed|&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;|      1|         1718|  10002|&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;|      1|         4418|  10003|&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;|      2|         1718|  10028|&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;|      2|         4418|  10029|&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;|      4|         1718|  10078|&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;|      4|         4418|  10204|&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;For the case where the client is using j:true and the journalCommitInterval is small, this gives a 17% or better speed improvement.  I&apos;m sold.  In the cases where clock time is not affected as much, we&apos;re still cutting disk I/O and so freeing up the system for other activity.&lt;/p&gt;</comment>
                            <comment id="353278" author="dnaumov" created="Wed, 5 Jun 2013 05:05:00 +0000"  >&lt;p&gt;Default project configuration builds into Any CPU, so on x64 machine it will run as x64 executable, there is no need to change anything.&lt;br/&gt;
Unfortunately I don&apos;t know the way to setup journalCommitInterval directly from benchmark, as you did in your js benchmark.&lt;/p&gt;</comment>
                            <comment id="353104" author="tad" created="Tue, 4 Jun 2013 23:20:59 +0000"  >&lt;p&gt;Yes, I had not set journalCommitInterval ... user error!  VS apparently defaulted to 32-bit ... ?  I haven&apos;t played with .NET on a 64-bit machine, and I guess I was expecting it to JIT to &quot;native&quot; (i.e. 64-bit) code ... I&apos;ll retest with JournalCommitInterval and 64-bit and see what happens.  Testing the slightly stale code from this morning, it at least is producing lines of output in minutes instead of no output in 20 minutes.&lt;/p&gt;

&lt;p&gt;I&apos;m testing on a RAID 0 pair of spinning disks at first.  I&apos;ll rebuild and let you know what I find tomorrow.&lt;/p&gt;

&lt;p&gt;Thanks for the tip(s)!&lt;/p&gt;</comment>
                            <comment id="352821" author="dnaumov" created="Tue, 4 Jun 2013 19:17:05 +0000"  >&lt;p&gt;I&apos;ve updated my github repo:&lt;br/&gt;
Changed to VS 2010&lt;br/&gt;
Added package restore&lt;br/&gt;
Added progress indication&lt;/p&gt;</comment>
                            <comment id="352744" author="dnaumov" created="Tue, 4 Jun 2013 18:01:15 +0000"  >&lt;p&gt;Tad,&lt;br/&gt;
you should create you new project targeting .NET 4.0 or you can switch target framework on existing project.&lt;br/&gt;
Concerning you benchmark performance the only idea I have is that you possibly forget set journalCommitInterval to 2 and syncDelay to something huge.&lt;br/&gt;
To debug this I would run it under debugger (use F5 to start) and then hit pause to see thread&apos;s stacks.&lt;/p&gt;</comment>
                            <comment id="352640" author="tad" created="Tue, 4 Jun 2013 16:18:31 +0000"  >&lt;p&gt;Hi Dmitry,&lt;/p&gt;

&lt;p&gt;I&apos;m trying to run your C# performance test and not having much luck.  This is probably user error on my part, but perhaps you could guide me in what to look for.&lt;/p&gt;

&lt;p&gt;I cloned your &lt;a href=&quot;https://github.com/DmitryNaumov/MongoDbVsMsSqlInsertPerformance&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/DmitryNaumov/MongoDbVsMsSqlInsertPerformance&lt;/a&gt; repo and created a new project in Visual Studio 2010 (since I didn&apos;t want to install VS 2012 on this machine).  I installed the MongoDB C# driver from NuGet and added references until VS stopped complaining.  I&apos;m using .NET 4.0 libraries, though it asked for 2.0 ... is that bad?&lt;/p&gt;

&lt;p&gt;When I run your program, it prints a header and then appears to run at slower than a sedated snail.  In 20 minutes of elapsed time, it has consumed 0.202 seconds of total CPU time and it is doing 120 bytes of I/O per second.  Performance Monitor shows it sending and receiving about 4 KB per second on the network.  Looking at the threads, all I ever see is waiting ...&lt;/p&gt;

&lt;p&gt;How would you debug this?&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;</comment>
                            <comment id="349761" author="dnaumov" created="Fri, 31 May 2013 12:41:26 +0000"  >&lt;p&gt;Thank you, Tad! This improvement won&apos;t be possible without your involvement and patience reading my posts in tangled english.&lt;br/&gt;
Hope we will continue our cooperative work and another issue, related to single-threaded compression.&lt;/p&gt;</comment>
                            <comment id="349744" author="tad" created="Fri, 31 May 2013 12:15:42 +0000"  >&lt;p&gt;Hi Dmitry,&lt;/p&gt;

&lt;p&gt;Thanks for investigating cluster sizes; it simplifies life a little to not have to modify code to optimize for that.&lt;/p&gt;

&lt;p&gt;I&apos;ve been tied up with some other things and so have been slow to do my verification testing of your patch, but I think that we are ready to make the change you suggested (remove the FILE_FLAG_WRITE_THROUGH flag) as soon as I get to testing.  It shouldn&apos;t be much longer.&lt;/p&gt;

&lt;p&gt;I see that you&apos;ve reopened your pull request, so we can merge it and you get will credit for the change in the Git changelog.  A small change that will make a big difference!&lt;/p&gt;

&lt;p&gt;Thanks again for all your work and for making MongoDB faster on Windows!  A lot of people will benefit from what you&apos;ve done, and we really appreciate it!&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;</comment>
                            <comment id="348616" author="dnaumov" created="Thu, 30 May 2013 07:07:26 +0000"  >&lt;p&gt;Tad,&lt;br/&gt;
you are right about cluster sizes. Benchmark shows no difference in results for different cluster sizes from 4K to 64K.&lt;br/&gt;
And documentation confirms it:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Alignment and File Access Requirements&lt;br/&gt;
As previously discussed, an application must meet certain requirements when working with files opened with FILE_FLAG_NO_BUFFERING. The following specifics apply:&lt;br/&gt;
File access sizes, including the optional file offset in the OVERLAPPED structure, if specified, must be for a number of bytes that is an integer multiple of the volume sector size. For example, if the sector size is 512 bytes, an application can request reads and writes of 512, 1,024, 1,536, or 2,048 bytes, but not of 335, 981, or 7,171 bytes.&lt;br/&gt;
File access buffer addresses for read and write operations should be physical sector-aligned, which means aligned on addresses in memory that are integer multiples of the volume&apos;s physical sector size. Depending on the disk, this requirement may not be enforced.&lt;/p&gt;

&lt;p&gt;Application developers should take note of new types of storage devices being introduced into the market with a physical media sector size of 4,096 bytes. The industry name for these devices is &quot;Advanced Format&quot;. As there may be compatibility issues with directly introducing 4,096 bytes as the unit of addressing for the media, a temporary compatibility solution is to introduce devices that emulate a regular 512-byte sector storage device but make available information about the true sector size through standard ATA and SCSI commands.&lt;/p&gt;&lt;/blockquote&gt;</comment>
                            <comment id="348229" author="dnaumov" created="Wed, 29 May 2013 20:11:23 +0000"  >&lt;p&gt;Tad,&lt;br/&gt;
It was obvious all performance improvements are related to reduced number of disk head seeks, but now I&apos;m lucky to find another software which, as well as my benchmarks, confirms my theory.&lt;/p&gt;

&lt;p&gt;Cluster sizes: in my understanding to write 8K block to 64K cluster OS should read 64K cluster, then map your modified 8K into cluster and after that write all 64K.&lt;br/&gt;
I&apos;m going to create small separate partition so I can play with different cluster sizes and we&apos;ll see am I right or not. Again, it&apos;s very important to interpret results correcly. Multiple factors exist like we already had journalCommitInterval and document size + compression and disk head seeks etc and all them combined can lead to wrong positive or negative result. Anyway there is already profit for me as I practiced many useful tools to analyze storage performance.&lt;/p&gt;

&lt;p&gt;I think you can easily reproduce same test with slightly modified version of you .js benchmark - results, I hope, should be the same.&lt;/p&gt;</comment>
                            <comment id="348182" author="tad" created="Wed, 29 May 2013 19:19:57 +0000"  >&lt;p&gt;Hi Dmitry,&lt;/p&gt;

&lt;p&gt;You keep posting interesting stuff ... thanks!&lt;/p&gt;

&lt;p&gt;Re: single-threaded journal compression.  I think you are right that this hurts performance in the case where writers are using j:true.  I don&apos;t know the &quot;snappy&quot; algorithm enough to say whether we could change to multi-threaded and keep the disk format unchanged.  If not, this is a delicate change potentially affecting forward-and-backward compatibility.  Thanks for filing &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9802&quot; title=&quot;Single-threaded journal compression becomes a bottleneck when using &amp;quot;durable&amp;quot; writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9802&quot;&gt;&lt;del&gt;SERVER-9802&lt;/del&gt;&lt;/a&gt; for this question!&lt;/p&gt;

&lt;p&gt;Re: Windows cluster size and 8 KB blocks.  My understanding is that cluster size is used in disk space allocation and does not determine disk I/O the way physical sector size does.  That is, I think that an 8 KB write with a 64 KB cluster size will still only write 8 KB.  If your measurements say otherwise, that would be interesting.  Larger clusters make for a smaller partition bitmap and potentially less fragmentation and so are more efficient in that sense, but I&apos;m not sure that we would write faster to a 64 KB cluster file system by writing larger blocks.  Let me know if I&apos;m wrong!&lt;/p&gt;

&lt;p&gt;Re: charts and performance improvement.  It does seem like your change cuts the number of disk seeks dramatically and this probably explains most of the performance gain.&lt;/p&gt;

&lt;p&gt;I&apos;ll try your C# program and let you know if I have trouble duplicating your result.  I still haven&apos;t tried PerfView but I will do that as well.&lt;/p&gt;

&lt;p&gt;Thanks again for all your work and research on this!&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;</comment>
                            <comment id="347911" author="dnaumov" created="Wed, 29 May 2013 14:19:22 +0000"  >&lt;p&gt;Actually I&apos;ve found another ace in my sleeve &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
Here are two graphs from Windows Performance Analyzer. First one is for unpatched version:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;27356_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/27356/27356_Pattern1.jpg&quot; title=&quot;Pattern1.jpg&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;27356&quot; file-preview-title=&quot;Pattern1.jpg&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/27356/_thumb_27356.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;br/&gt;
Green line at 0 is $MFT file, green line at 280M is journal file (j._2)&lt;br/&gt;
Vertical grey lines all between them are disk head seeks!&lt;/p&gt;

&lt;p&gt;Now compare with patched version:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;27357_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/27357/27357_Pattern2.jpg&quot; title=&quot;Pattern2.jpg&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;27357&quot; file-preview-title=&quot;Pattern2.jpg&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/27357/_thumb_27357.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Green line at 20M is journal. There are a few seeks, most of them to $MFT. That&apos;s it.&lt;/p&gt;</comment>
                            <comment id="347003" author="dnaumov" created="Tue, 28 May 2013 16:35:15 +0000"  >&lt;p&gt;Here are multi-threaded benchmark results. It is the same benchmark but with fixed document size equal to 8918.&lt;br/&gt;
There are 10K documents per thread to insert. So 1 thread should process 10K documents, 2 threads process 20K documents and so on.&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;td class=&apos;confluenceTd&apos;&gt;Threads&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Documents&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Unpatched&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Patched&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;      1&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    10000&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    22870&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  11545&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;      2&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    20000&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    21904&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  11381&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;      3&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    30000&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    23801&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  18800&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;      4&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    40000&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    26650&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  19169&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;      5&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    50000&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    27827&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  20784&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;      6&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    60000&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    29929&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  22083&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;      7&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    70000&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    31585&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  24373&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;      8&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    80000&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    33100&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  27405&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;I expected to see better results for patched version, so I&apos;ve started my yet another investigation.&lt;/p&gt;

&lt;p&gt;dur.cpp - durThread() is responsible for persisting pending journal writes (and also it is the place where we add at least 1 ms delay to our operation). As I understand there is dedicated thread which runs endless loop withing this method.&lt;br/&gt;
durThread calls durThreadGroupCommit() which calls groupCommit() which calls _groupCommit() which calls (yep, I know this looks annoying but wait a second) WRITETOJOURNAL which has this interesting line:&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;   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;j.journal(h, uncompressed);&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;&lt;b&gt;uncompressed&lt;/b&gt; looks very interesting!&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;        void Journal::journal(const JSectHeader&amp;amp; h, const AlignedBuilder&amp;amp; uncompressed) {&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;            RACECHECK&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;            static AlignedBuilder b(32*1024*1024);&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;            /* buffer to journal will be&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;               JSectHeader&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;               compressed operations&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;               JSectFooter&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;            const unsigned headTailSize = sizeof(JSectHeader) + sizeof(JSectFooter);&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;            const unsigned max = maxCompressedLength(uncompressed.len()) + headTailSize;&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.reset(max);&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;            {&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;                dassert( h.sectionLen() == (unsigned) 0xffffffff ); // we will backfill later&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.appendStruct(h);&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;&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;            size_t compressedLength = 0;&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;            rawCompress(uncompressed.buf(), uncompressed.len(), b.cur(), &amp;amp;compressedLength);&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;            verify( compressedLength &amp;lt; 0xffffffff );&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;            verify( compressedLength &amp;lt; max );&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;            b.skip(compressedLength);&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;Wait a second!!! Do you really compress pending buffers in &lt;b&gt;single&lt;/b&gt; thread?! I have 8 threads sleeping and waiting journal to be flushed on disk!!!&lt;/p&gt;

&lt;p&gt;Tad, tell me that I&apos;m wrong! &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
UPDATED: I don&apos;t want to insult anyone. I just meant that now it is all clear: unpatched version is limited by disk I/O and I expected to see better results for patched version because disk idles, but it is limited by single thread compression.&lt;/p&gt;

&lt;p&gt;I&apos;ve put all my aces on the table, I&apos;ve no idea what to prove further. May be you&apos;ll suggest any additional tests to run?&lt;/p&gt;</comment>
                            <comment id="346956" author="dnaumov" created="Tue, 28 May 2013 15:50:21 +0000"  >&lt;p&gt;Tad, meanwhile I&apos;m collecting multi-threaded benchmark result, I want to point out on another issue, imho, I saw in code. If I remember correctly, all writes to journal are made by 8K blocks. Which is fine untill my underlying filesystem cluster is less or equal 8K. But what if it is large, let&apos;s say 64K (which can be useful for 3TB disks)... What do you think, is it issue or not? Should I file it as separate issue?&lt;/p&gt;</comment>
                            <comment id="346707" author="dnaumov" created="Tue, 28 May 2013 09:32:07 +0000"  >&lt;p&gt;Updated benchmark results for latest sources in v2.4 (&lt;a href=&quot;https://github.com/mongodb/mongo/tree/v2.4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/tree/v2.4&lt;/a&gt;)&lt;br/&gt;
Benchmark code is available here (&lt;a href=&quot;https://github.com/DmitryNaumov/MongoDbVsMsSqlInsertPerformance/tree/master/MongoDbBenchmark&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/DmitryNaumov/MongoDbVsMsSqlInsertPerformance/tree/master/MongoDbBenchmark&lt;/a&gt;)&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;td class=&apos;confluenceTd&apos;&gt;Document Size&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;Elapsed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;           98&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  13608&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;          818&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  14332&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;         1718&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  16459&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;         4418&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  21108&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;         7118&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  22129&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;         8018&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  22414&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;         8918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  23208&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;         9918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  23288&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        10918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  23321&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        11918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  26454&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        12918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  26359&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        13918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  26473&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        14918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  26646&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        15918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  27503&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        16918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  26948&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        17918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  26838&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        18918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  27349&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        48918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  42665&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;        98918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  63959&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Don&apos;t see any significant difference with previous unpatched results.&lt;/p&gt;</comment>
                            <comment id="346326" author="tad" created="Mon, 27 May 2013 17:28:15 +0000"  >&lt;p&gt;Thanks, Dmitry!  Those are pretty compelling looking numbers!&lt;/p&gt;

&lt;p&gt;Can you post the code you used to do the benchmarks to help us reproduce the results?&lt;/p&gt;

&lt;p&gt;It would be nice to verify that there is no interaction with &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9242&quot; title=&quot;serverStatus workingSet and indexCounters not working on Windows&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9242&quot;&gt;&lt;del&gt;SERVER-9242&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9721&quot; title=&quot;Performance regression in Windows build&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9721&quot;&gt;&lt;del&gt;SERVER-9721&lt;/del&gt;&lt;/a&gt; since those also affected performance on some things quite a bit.  That is, we should verify that your change does the same thing (improves performance) with the other fixes, since they are already in the code (2.4.4-rc0 for example).&lt;/p&gt;

&lt;p&gt;Did you close your pull request?  (&lt;a href=&quot;https://github.com/mongodb/mongo/pull/431&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/pull/431&lt;/a&gt;)&lt;/p&gt;</comment>
                            <comment id="346232" author="dnaumov" created="Mon, 27 May 2013 13:25:54 +0000"  >&lt;p&gt;Here are my benchmarks with different document sizes.&lt;br/&gt;
Same environment as in previous post. All tests are run on HDD with journalCommitInterval is 2, syncdelay is set to 3000 to prevent MMF flushing during the test.&lt;/p&gt;

&lt;p&gt;Document size is the size of BSON serialized stream, not how it is transfered via network or stored on disk.&lt;br/&gt;
Elapsed time is average time (btw, should we use best, not average?) of three measurements, in milliseconds.&lt;/p&gt;

&lt;p&gt;Unpatched version refers to r2.4.3 tag &lt;a href=&quot;https://github.com/DmitryNaumov/mongo/tree/r2.4.3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/DmitryNaumov/mongo/tree/r2.4.3&lt;/a&gt;&lt;br/&gt;
Patched version with one line &quot;fix&quot; is &lt;a href=&quot;https://github.com/DmitryNaumov/mongo/tree/SERVER-9754&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/DmitryNaumov/mongo/tree/SERVER-9754&lt;/a&gt;&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;Document size&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Unpatched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Patched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Ratio&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;98&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;14261&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;10072&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.71&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;818&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;15310&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;10064&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.66&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;1718&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;18924&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;10069&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.53&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;4418&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;21345&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;10197&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.48&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;7118&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;21982&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;10204&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.46&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8018&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;22634&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;10203&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;8918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;23034&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;10434&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;9918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;23823&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;10422&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;10918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;24690&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;11146&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;11918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;26677&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;12885&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.48&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;12918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;27371&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;16289&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;13918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;26744&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;18766&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.70&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;14918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;27171&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;19269&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.71&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;15918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;27942&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;19649&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.70&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;16918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;27158&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;20259&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;17918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;28130&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;20111&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.71&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;18918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;28737&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;20059&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.70&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;48918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;42022&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;30389&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.72&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;98918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;65974&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;54118&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.82&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;208918&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;111400&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;105800&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.95&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Some observations:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;unpatched version produces much more load on HDD, according to performance counters&lt;/li&gt;
	&lt;li&gt;smaller documents gain more from patch than bigger documents - something else limits throughput (CPU: serialization/compression?)&lt;/li&gt;
	&lt;li&gt;for small documents in some range (&amp;lt;10000) patched version produces same results no matter what document size is&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;May be there is some correlation between cluster size and documents size but it&apos;s hard to understand due to number of factors like bson_size != storage_size, journal compression etc.&lt;/p&gt;

&lt;p&gt;UPDATED: I&apos;m rerunning benchmark for large documents because I forgot to restart mongod between tests.&lt;br/&gt;
UPDATED: I&apos;ve put new results. Now I&apos;m using best of 5 attempts because it is hard to produce stable results with average.&lt;/p&gt;</comment>
                            <comment id="344525" author="dnaumov" created="Fri, 24 May 2013 12:44:23 +0000"  >&lt;p&gt;I&apos;m doing some testing with different document sizes and number of concurrent threads. An idea suddenly struck me that in order to obtain stable results every single benchmark run should be less than syncdelay, otherwise I see additional disk activity when MMF&apos;s dirty pages are flushed to disk.&lt;/p&gt;</comment>
                            <comment id="343579" author="dnaumov" created="Thu, 23 May 2013 11:24:56 +0000"  >&lt;p&gt;Tad, you got me right. The speed of inserts is limited by journalCommitInterval and only in case with j:true. To see the difference between patched/unpatched we should use smallest journalCommitInterval possible, which is 2. Imho we don&apos;t see speedup with large documents because even with compression they are large that 8K, meaning journal grows at every insert. I don&apos;t want to do guessing, it would be better to preallocate journal and re-run benchmark.&lt;/p&gt;

&lt;p&gt;I do understand that single-threaded benchmark is very synthetic and I posted multi-threaded results in my blog. What I clearly saw is that patching greatly reduces disk load (performance counter &quot;disk queue size&quot; or ResourceMonitor&apos;s &quot;Active Time&quot;) making it available for other consumers, like queries for example. And I think this is real benefit for all mongo users and clients.&lt;/p&gt;</comment>
                            <comment id="343567" author="tad" created="Thu, 23 May 2013 11:01:20 +0000"  >&lt;p&gt;I was wondering about preallocation.  We do a test on Linux to decide if preallocation is faster, but on Windows it seems that we just don&apos;t preallocate.  I&apos;m not sure why the code is different for the two platforms.&lt;/p&gt;

&lt;p&gt;Testing with both small and large (and very large?  maybe 1 MB or larger?) documents seems like a good idea.  If a change is a huge win for small documents and not worse for larger ones, that would be good to know.&lt;/p&gt;</comment>
                            <comment id="343555" author="dnaumov" created="Thu, 23 May 2013 10:22:42 +0000"  >&lt;p&gt;Environment:&lt;/p&gt;

&lt;p&gt;Windows 7 Professional SP1 x64&lt;br/&gt;
Intel Core i7-2600 @ 3.40 GHz&lt;br/&gt;
SSD Corsair Force 3&lt;br/&gt;
HDD Seagate ST320DM000 320GB @ 7200 rpm&lt;br/&gt;
16 GB RAM&lt;/p&gt;

&lt;p&gt;More than 8 GB RAM is available during benchmark (which may be important for memory-mapped files architecture of mongo). Absence of CPU/IO activity during benchmark is verified by Process Explorer + Resource Monitor. A lot of pre-trimmed free space on SSD.&lt;/p&gt;

&lt;p&gt;Unpatched version refers to r2.4.3 tag &lt;a href=&quot;https://github.com/DmitryNaumov/mongo/tree/r2.4.3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/DmitryNaumov/mongo/tree/r2.4.3&lt;/a&gt;&lt;br/&gt;
Patched version with one line &quot;fix&quot; is &lt;a href=&quot;https://github.com/DmitryNaumov/mongo/tree/SERVER-9754&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/DmitryNaumov/mongo/tree/SERVER-9754&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Case 1: without j:true, default journalCommitInterval&lt;/p&gt;

&lt;p&gt;Unpatched HDD: 13846, 13698, 12619&lt;br/&gt;
Unpatched SSD: 11298, 10864, 11342&lt;/p&gt;

&lt;p&gt;Patched HDD: 13387, 12764, 13646&lt;br/&gt;
Patched SSD: 10493, 12577, 10690&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;Device&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Unpatched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Patched&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;HDD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;13388&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;13266&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;SSD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;11168&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;11253&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Case 2: with j:true, default journalCommitInterval&lt;/p&gt;

&lt;p&gt;Unpatched HDD: 79613, 79544, 79253&lt;br/&gt;
Unpatched SSD: 72018, 72321, 72049&lt;/p&gt;

&lt;p&gt;Patched HDD: 75782, 76490, 75897&lt;br/&gt;
Patched SSD: 72201, 71609, 71523&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;Device&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Unpatched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Patched&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;HDD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;79470&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;76056&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;SSD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;72129&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;71778&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Case 3: without j:true, journalCommitInterval 2&lt;/p&gt;

&lt;p&gt;Unpatched HDD: 14385, 13285, 13750&lt;br/&gt;
Unpatched SSD: 11277, 11851, 10132&lt;/p&gt;

&lt;p&gt;Patched HDD: 13814, 13837, 12314&lt;br/&gt;
Patched SSD: 10813, 12010, 11057&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;Device&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Unpatched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Patched&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;HDD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;13807&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;13322&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;SSD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;11087&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;11293&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Case 4: with j:true, journalCommitInterval 2 (this one really differs from your results)&lt;/p&gt;

&lt;p&gt;Unpatched HDD: 23639, 23003, 22997&lt;br/&gt;
Unpatched SSD: 18149, 16702, 16049&lt;/p&gt;

&lt;p&gt;Patched HDD: 19731, 20750, 19458&lt;br/&gt;
Patched SSD: 19059, 19414, 17603&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;Device&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Unpatched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Patched&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;HDD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;23213&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;19980&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;SSD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;16967&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;18692&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Case 5: same as case 4, but with small documents (only 10 ints in array, instead of 10K)&lt;/p&gt;

&lt;p&gt;Unpatched HDD: 3896, 3572, 3468&lt;br/&gt;
Unpatched SSD: 2614, 2573, 2223&lt;/p&gt;

&lt;p&gt;Patched HDD: 2329, 2322, 2283&lt;br/&gt;
Patched SSD: 2240, 2212, 2180&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;Device&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Unpatched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Patched&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;HDD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;3645&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&lt;b&gt;2311&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;SSD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;2470&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;2211&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;I&apos;ll prepare averages and tables later. &lt;/p&gt;

&lt;p&gt;It looks like, imho, it fits my theory: cases 1-3 should not depend on patch. Differences in average results are same as deviation of measurements. Case 4 shows improvements for HDD as I expected, but real break-through can be achieved only in case 5 with small documents.&lt;/p&gt;

&lt;p&gt;That means my one-liner fix is not enough. We should either preallocate journal files or grow them by larger blocks. I can do this and then we can re-measure case 4 again.&lt;/p&gt;</comment>
                            <comment id="343536" author="tad" created="Thu, 23 May 2013 09:34:11 +0000"  >&lt;p&gt;Hi Dmitry,&lt;/p&gt;

&lt;p&gt;Formatting first, since it&apos;s easy:&lt;/p&gt;

&lt;p&gt;The indented block with line numbers is done by putting {code} on the line before the quoted text and another {code} on the line after it.  You can get a scrolling block without line numbers by using {noformat} before and after instead of {code}.  I quoted the wavy braces with backslash in this paragraph to make them visible.&lt;/p&gt;

&lt;p&gt;Table are created using the vertical bar symbol &quot;|&quot; .  Each line begins and ends with one or two vertical bars, with text in between and separating columns.  Use doubled bars for the header, single bars for content lines.&lt;/p&gt;

&lt;p&gt;&amp;#124;&amp;#124;header 1&amp;#124;&amp;#124;header 2&amp;#124;&amp;#124;&lt;br/&gt;
&amp;#124;data 1&amp;#124;data 2&amp;#124;&lt;/p&gt;

&lt;p&gt;produces&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;header 1&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;header 2&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;data 1&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;data 2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Some of this is documented at &lt;a href=&quot;https://jira.mongodb.org/secure/WikiRendererHelpAction.jspa?section=texteffects&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/secure/WikiRendererHelpAction.jspa?section=texteffects&lt;/a&gt; , which you can get to from the &quot;?&quot; symbol below the comment entry box.  You can click the button to the left of the &quot;?&quot; to see a preview to see if the formatting is working as you expected.&lt;/p&gt;

&lt;p&gt;If I understand your comments, I should test j: true to see the changes made by the patch.  Did I get that right?&lt;/p&gt;

&lt;p&gt;Paraphrasing, the speed of inserts will be limited (with j: true) by the journalCommitInterval, so shorter intervals should make everything faster and may make the improvements from the patch more visible.  Does that sound right to you?&lt;/p&gt;

&lt;p&gt;I think you&apos;re saying that inserting documents that are over 8 KB each (as with the 10,000 element array) will mask the effect of the change by growing the journal file on every write.  This would make the &quot;unnecessary&quot; metadata writes &quot;necessary&quot;, preventing the optimization from happening.&lt;/p&gt;

&lt;p&gt;Note that the journal is compressed, so an 8 KB document may be smaller than 8 KB in the journal.&lt;/p&gt;

&lt;p&gt;My understanding of the documentation (and interpreting the flag name FILE_FLAG_WRITE_THROUGH as meaningful) suggests that the metadata will be written in any case, but that FILE_FLAG_WRITE_THROUGH causes it to happen at the time of the write.  This may be why we don&apos;t always see a speedup; we haven&apos;t prevented the writes, just moved them in time.&lt;/p&gt;

&lt;p&gt;It is also important to remember that this is a single-threaded (single client) test, and that the effects may be different with multiple clients trying to write at the same time.  It is also vastly more complicated with multiple clients, since we enter a world of write locks and yielding heuristics.  It might be informative to do additional benchmarking with parallel shells (look for startParallelShell in the JavaScript source code in src/mongo/shell/servers_misc.js and in the jstests files) and with benchRun (&lt;a href=&quot;http://www.mongodb.org/about/contributors/js-benchmarking-harness/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.mongodb.org/about/contributors/js-benchmarking-harness/&lt;/a&gt;).  We would like to improve the multi-user case, since that is the common use case.&lt;/p&gt;

&lt;p&gt;Reducing unnecessary disk I/O should improve all cases so these goals are not necesarily in conflict, but we need to test both to be sure.&lt;/p&gt;

&lt;p&gt;Thanks for your work on this!&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;</comment>
                            <comment id="343524" author="dnaumov" created="Thu, 23 May 2013 08:54:03 +0000"  >&lt;p&gt;Tad,&lt;br/&gt;
I have your benchmark results (which are very similar to yours... except case 4) and while I&apos;m trying to prepare nice and shiny report I want you to think about one thing. In my post I mentioned that actually journal files should be preallocated to get maximum performance, but it doesn&apos;t really matters in my benchmark. Why? When journal file grows, metadata should be updated. This costs disk I/O and you can&apos;t avoid it. Journal grows by 8K blocks (I can find that in sources if needed). But it doesn&apos;t grow every test iteration in my benchmark, because my documents are small, much smaller that 8K. But your benchmark is the opposite. Array of 10K integers is large than 8K and this means that every time you write to journal it grows and filesystem metadata is also updated. That&apos;s my theory, I&apos;ll check with PerfView if metadata is really updated on every insert if journal grows.&lt;/p&gt;

&lt;p&gt;As I said before, when inserting large documents key point is either preallocate journal file or (as MS SQL does) let it grow by huge blocks, not every 8K.&lt;/p&gt;</comment>
                            <comment id="343440" author="dnaumov" created="Thu, 23 May 2013 05:43:05 +0000"  >&lt;p&gt;Tad,&lt;br/&gt;
thank you for your test and detailed results &amp;amp; explanation. I will run it shortly as soon as I get to same desktop I used for my measurements.&lt;br/&gt;
But before I dare to comment some results:&lt;/p&gt;

&lt;p&gt;1. without j: true, default journalCommitInterval: with no journaling disk should not matter, same results should be for both HDD and SSD. With default journalCommitInterval = 100 ms it also doesn&apos;t matter do we do additional disk I/O to update timestamp or not. That&apos;s my explanation, I don&apos;t have the answer why you saw -13% speedup yet.&lt;/p&gt;

&lt;p&gt;2. with j: true, default journalCommitInterval: as I explained in one of my posts (&lt;a href=&quot;http://dmitry-naumov.blogspot.ru/2013/05/mongodb-vs-ms-sql-journalcommitinterval.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://dmitry-naumov.blogspot.ru/2013/05/mongodb-vs-ms-sql-journalcommitinterval.html&lt;/a&gt;) default journalCommitInterval adds a 100/3 + 1 = 34 ms penalty for each insert. That&apos;s why you can&apos;t get results better that 2000 iterations * 34 ms = 68000. In my understanding this added latency hides any additional disk I/O costs and again HDD and SSD should score near the same results.&lt;/p&gt;

&lt;p&gt;3. without j: true, journalCommitInterval 2: same as case 1, benchmark doesn&apos;t depend on disk at all, result should be close to those obtained in case 1. Yes, journal is updated more frequently, I would agree it may affect other queries which hit the disk, but don&apos;t see how this affects benchmark.&lt;/p&gt;

&lt;p&gt;4. with j: true, journalCommitInterval 2: imho the only case where my patch matters. What wonders me is only 2 times better results than in case 2. While journalCommitInterval is reduced from 100 to 2, means that total test added latency is reduced from 68000 to 2000 and what we got is 38314 vs 80125 (unpatched) and 36047 vs 81819 (patched). If you saw my post when I figured out about journalCommitInterval, my improvement was from 29 insert/sec to 700 insert/second which make sense for me. Also in this case without patch SSD should outperform HDD quite well, because disk I/O costs much less for SSD.&lt;/p&gt;

&lt;p&gt;It would be nice if you re-run case 4 or may be you have explanation of so smal improvement of case 4 vs case 2.&lt;/p&gt;

&lt;p&gt;I&apos;ll come back shortly with my results of your benchmark, but to remove additional factors I am going to run it agains pure r2.4.3 and against my patched version of 2.4.3 which differs only in 1 line.&lt;/p&gt;

&lt;p&gt;BTW, Tad, how do you post such well-formatted text? What do you use to format code and tables? Thanks!&lt;/p&gt;</comment>
                            <comment id="343208" author="tad" created="Wed, 22 May 2013 22:29:07 +0000"  >&lt;p&gt;Hi Dmitry,&lt;/p&gt;

&lt;p&gt;I did some benchmarking today, and the results I got were not the solid win I was hoping for.  Out of 8 cases I tested, your patch made 5 of them faster and 3 slower.&lt;/p&gt;

&lt;p&gt;I wrote a test script and ran it on two builds of mongod.exe; one with the fix for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9721&quot; title=&quot;Performance regression in Windows build&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9721&quot;&gt;&lt;del&gt;SERVER-9721&lt;/del&gt;&lt;/a&gt; and one with that fix and your patch.&lt;/p&gt;

&lt;p&gt;Here&apos;s the test file I ran.  The &quot;&apos;&amp;#45;&amp;#45;journalCommitInterval&apos;, &apos;2&apos;&quot; arguments were only there for the sections marked &quot;journalCommitInterval 2&quot; in the tables.  I passed either &quot;&amp;#45;&amp;#45;eval &apos;waitForJournal=false&apos;&quot; or &quot;&amp;#45;&amp;#45;eval &apos;waitForJournal=true&apos;&quot; on the command line.  I tested on a Seagate 2 TB hard disk and on a Samsung 840 Pro SSD.&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;// Test the performance of saving to a collection with and without j: true.&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;// Related to SERVER-9754.&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;&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;var makeArray = function () {&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;    var arr = [];&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;    for (var i = 0; i &amp;lt; 10000; ++i) {&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;        arr.push(i);&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;    return arr;&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;&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;var writeData = function (testDB, arr, waitForJournal) {&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;    var howMany = 2000;&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;    for (var i = 0; i &amp;lt; howMany; ++i) {&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;        testDB.test.insert({ i: i, arr: arr });&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 (waitForJournal) {&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;            testDB.test.runCommand({ getLastError: 1, j: true });&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;    }&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;&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;var time = function (f, testDB, arr, waitForJournal) {&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;    var start = new ISODate();&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(testDB, arr, waitForJournal);&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;    var end = new ISODate();&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;    return (end - start);&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;&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;var doTest = function (waitForJournal) {&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;    // Time creation of the test collection&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;    var baseName = &apos;save_performance&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;    var dbpath = &apos;/data/db/perfTests/&apos; + baseName&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;    var port = allocatePorts(1)[0];&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;    var mongod = startMongod(&apos;--port&apos;, port, &apos;--dbpath&apos;, dbpath, &apos;--journalCommitInterval&apos;, &apos;2&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;    sleep(50);&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;    testDB = new Mongo(&apos;localhost:&apos; + port).getDB(baseName);&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;    testDB.dropDatabase();&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;    sleep(50);&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;    var arr = makeArray();&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;    var saveTime = time(writeData, testDB, arr, waitForJournal);&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;    stopMongod(port, 15);&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;    jsTest.log(&apos;Test &apos; + (waitForJournal ? &apos;with&apos; : &apos;without&apos;) + &apos; waitForJournal took &apos; + saveTime + &apos; ms&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;&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;   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;doTest(waitForJournal);&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;Each of the numbers below is the number of milliseconds to complete the test, and is the average of three trials, each in a clean directory.  There was some variation in some of the timings, and I don&apos;t have a theory for why that would happen.  The tests were run on an otherwise idle desktop computer under Windows 7, no virtualization and nothing competing for CPU or disk I/O.  But the variability does not explain the differences.  In the first data line below, the 14718 number is the average of 14727, 14727 and 14700 while the 16650 number is the average of 19808, 15407 and 14735.  This makes the best of the &quot;patched&quot; times slower than the worst of the &quot;unpatched&quot; times.&lt;/p&gt;

&lt;p&gt;Windows without j: true, default journalCommitInterval:&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;Device&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Unpatched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Patched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Speedup&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;spinning disk&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;14718&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;16650&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;-13.13%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;SSD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;13590&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;13282&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;2.27%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Windows with j: true, default journalCommitInterval:&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;Device&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Unpatched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Patched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Speedup&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;spinning disk&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;80125&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;81819&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;-2.11%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;SSD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;76154&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;75635&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;0.68%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Windows without j: true, journalCommitInterval 2:&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;Device&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Unpatched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Patched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Speedup&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;spinning disk&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;12397&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;13379&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;-7.92%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;SSD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;11705&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;11351&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;3.02%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Windows with j: true, journalCommitInterval 2:&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;Device&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Unpatched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Patched&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;Speedup&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;spinning disk&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;38314&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;36047&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;5.92%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;SSD&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;33457&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;32469&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;2.95%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;p&gt;Since these results are so different from what you posted, I&apos;m wondering if you can provide a better test, one that will show results like what you saw.&lt;/p&gt;

&lt;p&gt;Your explanation makes logical sense; don&apos;t do disk I/O to update timestamps, and things should be faster.  We may be seeing some of this in these results, but we&apos;re also seeing slowdowns that don&apos;t match the theory.&lt;/p&gt;

&lt;p&gt;The fix for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9721&quot; title=&quot;Performance regression in Windows build&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9721&quot;&gt;&lt;del&gt;SERVER-9721&lt;/del&gt;&lt;/a&gt; went into the master and 2.4 branches today and so it should show up in the nightly builds soon.&lt;/p&gt;

&lt;p&gt;If you can post a better test than what I tried, that would be great, thanks!&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;</comment>
                            <comment id="341514" author="dnaumov" created="Wed, 22 May 2013 13:36:39 +0000"  >&lt;p&gt;Tad,&lt;br/&gt;
at a glance &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9721&quot; title=&quot;Performance regression in Windows build&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9721&quot;&gt;&lt;del&gt;SERVER-9721&lt;/del&gt;&lt;/a&gt; may be connected with my findings, but I don&apos;t see any connections with &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9242&quot; title=&quot;serverStatus workingSet and indexCounters not working on Windows&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9242&quot;&gt;&lt;del&gt;SERVER-9242&lt;/del&gt;&lt;/a&gt;. Let me know when &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9721&quot; title=&quot;Performance regression in Windows build&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9721&quot;&gt;&lt;del&gt;SERVER-9721&lt;/del&gt;&lt;/a&gt; is fixed, so I can recheck everything again.&lt;/p&gt;

&lt;p&gt;BTW, I&apos;ve submitted my proposed solution &lt;a href=&quot;https://github.com/mongodb/mongo/pull/431&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/pull/431&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="341502" author="tad" created="Wed, 22 May 2013 13:20:47 +0000"  >&lt;p&gt;Hi Dmitry,&lt;/p&gt;

&lt;p&gt;Thanks a lot for this report!&lt;/p&gt;

&lt;p&gt;If you have been looking at version 2.4.3 in Windows (as your Affects Version and Environment say), then you are hitting both &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9242&quot; title=&quot;serverStatus workingSet and indexCounters not working on Windows&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9242&quot;&gt;&lt;del&gt;SERVER-9242&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9721&quot; title=&quot;Performance regression in Windows build&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9721&quot;&gt;&lt;del&gt;SERVER-9721&lt;/del&gt;&lt;/a&gt;, which clobber Windows performance.  &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9242&quot; title=&quot;serverStatus workingSet and indexCounters not working on Windows&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9242&quot;&gt;&lt;del&gt;SERVER-9242&lt;/del&gt;&lt;/a&gt; is fixed in the 2.4 nightly and the fix for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9721&quot; title=&quot;Performance regression in Windows build&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9721&quot;&gt;&lt;del&gt;SERVER-9721&lt;/del&gt;&lt;/a&gt; is coming soon.  If would be great if you could update your results once &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9721&quot; title=&quot;Performance regression in Windows build&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9721&quot;&gt;&lt;del&gt;SERVER-9721&lt;/del&gt;&lt;/a&gt; is fixed and see if the journaling continues to be a performance bottleneck for you.&lt;/p&gt;

&lt;p&gt;We&apos;ll be testing your suggestion; it is much appreciated!&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="27356" name="Pattern1.jpg" size="99962" author="dnaumov" created="Wed, 29 May 2013 14:15:11 +0000"/>
                            <attachment id="27357" name="Pattern2.jpg" size="144881" author="dnaumov" created="Wed, 29 May 2013 14:15:11 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>31.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, 22 May 2013 13:20:47 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        10 years, 29 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            10 years, 29 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>dnaumov</customfieldvalue>
            <customfieldvalue>tad</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmsbr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrqpuf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>69694</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_10166" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Tests Written</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10153"><![CDATA[Unneeded]]></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|hrljyn:</customfieldvalue>

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