Skip to content

Commit 5a7a056

Browse files
(DOCS-13376): Add performance warnings for validation
1 parent 79835df commit 5a7a056

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

source/reference/command/validate.txt

+16
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ Definition
7171
Behavior
7272
--------
7373

74+
Performance
75+
~~~~~~~~~~~
76+
7477
The :dbcommand:`validate` command can be slow, particularly on
7578
larger data sets.
7679

@@ -80,6 +83,19 @@ until the operation finishes. When run on a secondary, the
8083
:dbcommand:`validate` operation can block all other operations on that
8184
secondary until it finishes.
8285

86+
.. warning::
87+
88+
Due to the performance impact of validation, consider running
89+
:dbcommand:`validate` only on :term:`secondary` replica set nodes.
90+
You can use :method:`rs.stepDown()` to instruct the current
91+
:term:`primary` node to become a secondary to avoid impacting a live
92+
primary node.
93+
94+
Data Throughput Metrics
95+
~~~~~~~~~~~~~~~~~~~~~~~
96+
97+
.. include:: /includes/extracts/4.4-validate-data-throughput.rst
98+
8399
Restrictions
84100
~~~~~~~~~~~~~
85101

source/reference/method/db.collection.validate.txt

+15-3
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,29 @@ Description
7070
Behavior
7171
--------
7272

73+
Performance
74+
~~~~~~~~~~~
75+
7376
The :method:`db.collection.validate()` method is potentially resource
74-
intensive and may impact the performance of your MongoDB instance.
77+
intensive and may impact the performance of your MongoDB instance,
78+
particularly on larger data sets.
7579

7680
The :method:`db.collection.validate()` method obtains an exclusive lock
7781
on the collection. This will block all reads and writes on the
7882
collection until the operation finishes. When run on a secondary, the
7983
operation can block all other operations on that secondary until it
8084
finishes.
8185

82-
The :method:`db.collection.validate()` method can be slow, particularly
83-
on larger data sets.
86+
.. warning::
87+
88+
Due to the performance impact of validation, consider running
89+
:method:`db.collection.validate()` only on :term:`secondary` replica
90+
set nodes. You can use :method:`rs.stepDown()` to instruct the
91+
current :term:`primary` node to become a secondary to avoid
92+
impacting a live primary node.
93+
94+
Data Throughput Metrics
95+
~~~~~~~~~~~~~~~~~~~~~~~
8496

8597

8698
Examples

0 commit comments

Comments
 (0)