@@ -577,38 +577,28 @@ Possible causes of replication lag include:
577
577
Use the :term:`database profiler` to see if there are slow queries
578
578
or long-running operations that correspond to the incidences of lag.
579
579
580
- - **Oplog Size is Too Small for the Data Load**
581
-
582
- If you do not set your oplog large enough, the oplog overwrites old
583
- data before the secondaries can read it. The oplog is a circular
584
- buffer, and when full it erases the oldest commands in order to write
585
- new ones. If your oplog size is too small, the secondaries reach a
586
- point where they no longer can access certain updates. The secondaries
587
- become stale.
588
-
589
- To set oplog size, see :doc:`/tutorial/change-oplog-size`.
590
-
591
- - **Failure to Use Appropriate Write Concern in a High-Write Environment**
592
-
593
- If the primary is making a very high number of writes and if you have
594
- not set the appropriate write concern, the secondaries will not be
595
- able to read the oplog fast enough to keep up with changes. Write
596
- requests take precedence over read requests, and a very large number
597
- of writes will significantly reduce the numbers of reads the
598
- secondaries can make on the oplog in order to update themselves.
599
-
600
- The replication lag can grow to the point that the oplog overwrites
601
- commands that the secondaries have not yet read. The oplog is a
602
- circular buffer, and when full it erases the oldest commands in order
603
- to write new ones. If the secondaries get too far behind in their
604
- reads, they reach a point where they no longer can access certain
605
- updates, and so the secondaries become stale.
580
+ - **Appropriate Write Concern**
581
+
582
+ If you are performing a large data load that requires a very high
583
+ number of writes to the primary, and if you have not set the
584
+ appropriate write concern, the secondaries will not be able to read
585
+ the oplog fast enough to keep up with changes. Write requests take
586
+ precedence over read requests, and a very large number of writes will
587
+ significantly reduce the numbers of reads the secondaries can make
588
+ from the oplog in order to update themselves.
589
+
590
+ The replication lag can grow to the point that the oplog over-writes
591
+ commands that the secondaries have not yet read. The oplog is a capped
592
+ collection, and when full it erases the oldest commands in order to
593
+ write new ones. If the secondaries get too far behind in their reads,
594
+ they reach a point where they no longer have access to certain
595
+ updates, and they become stale.
606
596
607
597
To prevent this, use "write concern" to tell MongoDB to always perform
608
598
a safe write after a designated number of inserts, such as after every
609
- 1,000 inserts. This provides a space for the secondaries to catch up
610
- with the primary. Setting a write concern does slightly slow down the
611
- data load, but it keeps your secondaries from going stale.
599
+ 1,000 inserts. This provides a space for the secondaries to perform
600
+ reads and catch up with the primary. Using safe writes slightly slows
601
+ down the data load but keeps your secondaries from going stale.
612
602
613
603
See :ref:`replica-set-write-concern` for more information.
614
604
0 commit comments