From 460acb836445e42960346bdb95a83553db8df018 Mon Sep 17 00:00:00 2001 From: David Storch Date: Thu, 13 Feb 2020 14:42:31 -0500 Subject: [PATCH] SERVER-46161 Increase number of PlanExecutor iterations before yielding to 1000. The new behavior is for queries to yield every 10ms or 1000 iterations, whichever comes first. This change improves performance on many of our workloads, since yielding is expensive and happens more frequently than needed on those workloads. --- jstests/noPassthrough/query_knobs_validation.js | 4 ++-- src/mongo/db/query/query_knobs.idl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jstests/noPassthrough/query_knobs_validation.js b/jstests/noPassthrough/query_knobs_validation.js index a6c0cba6b54..aa0c21f32f4 100644 --- a/jstests/noPassthrough/query_knobs_validation.js +++ b/jstests/noPassthrough/query_knobs_validation.js @@ -28,7 +28,7 @@ const expectedParamDefaults = { internalQueryPlanOrChildrenIndependently: true, internalQueryMaxScansToExplode: 200, internalQueryMaxBlockingSortMemoryUsageBytes: 100 * 1024 * 1024, - internalQueryExecYieldIterations: 128, + internalQueryExecYieldIterations: 1000, internalQueryExecYieldPeriodMS: 10, internalQueryFacetBufferSizeBytes: 100 * 1024 * 1024, internalDocumentSourceCursorBatchSizeBytes: 4 * 1024 * 1024, @@ -39,7 +39,7 @@ const expectedParamDefaults = { internalQueryMaxPushBytes: 100 * 1024 * 1024, internalQueryMaxAddToSetBytes: 100 * 1024 * 1024, // Should be half the value of 'internalQueryExecYieldIterations' parameter. - internalInsertMaxBatchSize: 64, + internalInsertMaxBatchSize: 500, internalQueryPlannerGenerateCoveredWholeIndexScans: false, internalQueryIgnoreUnknownJSONSchemaKeywords: false, internalQueryProhibitBlockingMergeOnMongoS: false, diff --git a/src/mongo/db/query/query_knobs.idl b/src/mongo/db/query/query_knobs.idl index 9eaee626499..4b4fd4a852d 100644 --- a/src/mongo/db/query/query_knobs.idl +++ b/src/mongo/db/query/query_knobs.idl @@ -212,7 +212,7 @@ server_parameters: set_at: [ startup, runtime ] cpp_varname: "internalQueryExecYieldIterations" cpp_vartype: AtomicWord - default: 128 + default: 1000 internalQueryExecYieldPeriodMS: description: "Yield if it's been at least this many milliseconds since we last yielded."