Skip to content

Commit

Permalink
durThread should try to commit sooner if data is piling up. hopefully…
Browse files Browse the repository at this point in the history
… then a commitIfNeeded invocation, which is uglier, is then avoided
  • Loading branch information
dwight committed May 8, 2012
1 parent b7aec8e commit 822d02f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/mongo/db/dur.cpp
Expand Up @@ -796,14 +796,13 @@ namespace mongo {
try {
stats.rotate();

// we do this in a couple blocks (the invoke()), which makes it a tiny bit faster (only a little) on throughput,
// but is likely also less spiky on our cpu usage, which is good.

// commit sooner if one or more getLastError j:true is pending
sleepmillis(oneThird);
for( unsigned i = 1; i <= 2; i++ ) {
if( commitJob._notify.nWaiting() )
break;
if( commitJob.bytes() > UncommittedBytesLimit / 2 )
break;
sleepmillis(oneThird);
}

Expand Down

0 comments on commit 822d02f

Please sign in to comment.