From b7eed97549384fc0d9073a828965370c780df871 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Tue, 19 Feb 2013 13:08:31 -0500 Subject: [PATCH] DOCS-871 multithreaded replication --- source/core/replication-internals.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/core/replication-internals.txt b/source/core/replication-internals.txt index 3d08a01776a..5c1ca8f09e2 100644 --- a/source/core/replication-internals.txt +++ b/source/core/replication-internals.txt @@ -304,6 +304,22 @@ behaviors: value, either ``true`` or ``false``, for the :data:`members[n].buildIndexes` field. +Multithreaded Replication +------------------------- + +MongoDB supports multithreaded replication by applying write operations +on secondary nodes in batches. Each batch is divided among many threads. +The multithreaded writes allow for concurrent CPU usage. + +Despite the multithreaded writes, reads on secondaries do not "see" +operations applied out of order. While the threads are writing, MongoDB +blocks read operations, even if the write operations yield. + +Before writing a batch of oplog operations, MongoDB fetches all the +memory pages that contain the data and indexes to be written. The +prefetch stage minimizes the amount of time MongoDB must hold the write +lock to apply operations. + Pre-Fetching Indexes to Improve Replication Throughput ------------------------------------------------------