From 822d02fb1030fda3a9ae8a79049a788d68b78897 Mon Sep 17 00:00:00 2001 From: Dwight Date: Tue, 8 May 2012 12:38:08 -0400 Subject: [PATCH] durThread should try to commit sooner if data is piling up. hopefully then a commitIfNeeded invocation, which is uglier, is then avoided --- src/mongo/db/dur.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mongo/db/dur.cpp b/src/mongo/db/dur.cpp index e060155bae065..ce598955c3498 100644 --- a/src/mongo/db/dur.cpp +++ b/src/mongo/db/dur.cpp @@ -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); }