summaryrefslogtreecommitdiff
path: root/src/mongo/db/query
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2014-11-17 22:16:15 -0500
committerDavid Storch <david.storch@10gen.com>2014-11-17 22:16:15 -0500
commitb32c91b8cb3a6bd214f31a962a6ef4556225bfc4 (patch)
treef2e120d92b1b1f03320cbc3219705ed33d3fc8b5 /src/mongo/db/query
parentd0cd11123e114ea8cea33e37d06d1cf43c41727b (diff)
downloadmongo-b32c91b8cb3a6bd214f31a962a6ef4556225bfc4.tar.gz
SERVER-16159 MMAP v1 does timing-based yields for inserts
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r--src/mongo/db/query/plan_yield_policy.cpp5
-rw-r--r--src/mongo/db/query/query_knobs.cpp4
-rw-r--r--src/mongo/db/query/query_knobs.h8
3 files changed, 14 insertions, 3 deletions
diff --git a/src/mongo/db/query/plan_yield_policy.cpp b/src/mongo/db/query/plan_yield_policy.cpp
index a5aa97ed6ea..63abf57105a 100644
--- a/src/mongo/db/query/plan_yield_policy.cpp
+++ b/src/mongo/db/query/plan_yield_policy.cpp
@@ -31,15 +31,14 @@
#include "mongo/db/query/plan_yield_policy.h"
#include "mongo/db/global_environment_experiment.h"
+#include "mongo/db/query/query_knobs.h"
#include "mongo/db/query/query_yield.h"
#include "mongo/db/storage/record_fetcher.h"
namespace mongo {
- // Yield every 128 cycles or 10ms. These values were inherited from v2.6, which just copied
- // them from v2.4.
PlanYieldPolicy::PlanYieldPolicy(PlanExecutor* exec)
- : _elapsedTracker(128, 10),
+ : _elapsedTracker(internalQueryExecYieldIterations, internalQueryExecYieldPeriodMS),
_planYielding(exec) { }
bool PlanYieldPolicy::shouldYield() {
diff --git a/src/mongo/db/query/query_knobs.cpp b/src/mongo/db/query/query_knobs.cpp
index 054c9fc2d44..b269e87f314 100644
--- a/src/mongo/db/query/query_knobs.cpp
+++ b/src/mongo/db/query/query_knobs.cpp
@@ -64,4 +64,8 @@ namespace mongo {
MONGO_EXPORT_SERVER_PARAMETER(internalQueryExecMaxBlockingSortBytes, int, 32 * 1024 * 1024);
+ // Yield every 128 cycles or 10ms.
+ MONGO_EXPORT_SERVER_PARAMETER(internalQueryExecYieldIterations, int, 128);
+ MONGO_EXPORT_SERVER_PARAMETER(internalQueryExecYieldPeriodMS, int, 10);
+
} // namespace mongo
diff --git a/src/mongo/db/query/query_knobs.h b/src/mongo/db/query/query_knobs.h
index 453a5e372c7..b2363fb326b 100644
--- a/src/mongo/db/query/query_knobs.h
+++ b/src/mongo/db/query/query_knobs.h
@@ -98,4 +98,12 @@ namespace mongo {
extern int internalQueryExecMaxBlockingSortBytes;
+ // Yield after this many "should yield?" checks. Only applies to storage engines that
+ // do not support doc-level locking.
+ extern int internalQueryExecYieldIterations;
+
+ // Yield if it's been at least this many milliseconds since we last yielded. Only applies
+ // to storage engines that do not support doc-level locking.
+ extern int internalQueryExecYieldPeriodMS;
+
} // namespace mongo