diff options
author | Sam Rossi <sam.rossi@mongodb.com> | 2016-10-12 11:24:47 -0400 |
---|---|---|
committer | Sam Rossi <sam.rossi@mongodb.com> | 2016-10-12 18:19:33 -0400 |
commit | bf547fcd6cb2538ac9bbe78ee88c485c468d6ad8 (patch) | |
tree | 51a195f3fec3bc9485f7e835358d04d0a285ef77 | |
parent | 7b58433eec6437176f16ab4955b20c33a772aae8 (diff) | |
download | mongo-bf547fcd6cb2538ac9bbe78ee88c485c468d6ad8.tar.gz |
SERVER-25821 make max insert batch size on primary tunable
-rw-r--r-- | src/mongo/db/ops/write_ops_exec.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/query/query_knobs.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/query/query_knobs.h | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp index cba843c9315..67a0dc2f7e7 100644 --- a/src/mongo/db/ops/write_ops_exec.cpp +++ b/src/mongo/db/ops/write_ops_exec.cpp @@ -436,7 +436,7 @@ WriteResult performInserts(OperationContext* txn, const InsertOp& wholeOp) { size_t bytesInBatch = 0; std::vector<BSONObj> batch; - const size_t maxBatchSize = internalQueryExecYieldIterations / 2; + const size_t maxBatchSize = internalInsertMaxBatchSize; batch.reserve(std::min(wholeOp.documents.size(), maxBatchSize)); for (auto&& doc : wholeOp.documents) { diff --git a/src/mongo/db/query/query_knobs.cpp b/src/mongo/db/query/query_knobs.cpp index 8a982f1a2f6..a05a1c073d8 100644 --- a/src/mongo/db/query/query_knobs.cpp +++ b/src/mongo/db/query/query_knobs.cpp @@ -68,4 +68,8 @@ MONGO_EXPORT_SERVER_PARAMETER(internalQueryExecYieldPeriodMS, int, 10); MONGO_EXPORT_SERVER_PARAMETER(internalQueryFacetBufferSizeBytes, int, 100 * 1024 * 1024); +MONGO_EXPORT_SERVER_PARAMETER(internalInsertMaxBatchSize, + int, + internalQueryExecYieldIterations / 2); + } // namespace mongo diff --git a/src/mongo/db/query/query_knobs.h b/src/mongo/db/query/query_knobs.h index eb3f79ca0ab..4b3a0760c65 100644 --- a/src/mongo/db/query/query_knobs.h +++ b/src/mongo/db/query/query_knobs.h @@ -111,4 +111,6 @@ const int64_t insertVectorMaxBytes = 256 * 1024; // The number of bytes to buffer at once during a $facet stage. extern std::atomic<int> internalQueryFacetBufferSizeBytes; // NOLINT +extern std::atomic<int> internalInsertMaxBatchSize; // NOLINT + } // namespace mongo |