Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions source/reference/log-messages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,38 @@ See the :ref:`examples section <log-message-json-examples>` for a
:ref:`pretty-printed <log-message-pretty-printing>` version of this log
entry.

.. _log-messages-remoteOpWaitMillis:

Time Waiting for Shards Logged in ``remoteOpWaitMillis`` Field
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 5.0

Starting in MongoDB 5.0, you can use the ``remoteOpWaitMillis`` log
field to obtain the wait time (in milliseconds) for results from
:term:`shards <shard>`.

``remoteOpWaitMillis`` is only logged:

- If you configure :ref:`slow operations logging
<log-message-slow-ops>`.

- On the :term:`shard` or :binary:`~bin.mongos` that merges the results.

To determine if a merge operation or a shard issue is causing a slow
query, compare the ``durationMillis`` and ``remoteOpWaitMillis`` time
fields in the log. ``durationMillis`` is the total time the query took
to complete. Specifically:

- If ``durationMillis`` is slightly longer than ``remoteOpWaitMillis``,
then most of the time was spent waiting for a shard response. For
example, ``durationMillis`` of 17 and ``remoteOpWaitMillis`` of 15.

- If ``durationMillis`` is significantly longer than
``remoteOpWaitMillis``, then most of the time was spent performing the
merge. For example, ``durationMillis`` of 100 and
``remoteOpWaitMillis`` of 15.

.. _log-message-parsing:

Parsing Structured Log Messages
Expand Down
7 changes: 7 additions & 0 deletions source/release-notes/5.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,13 @@ Starting in MongoDB 5.0, :ref:`slow operation
<database-profiling-specify-slowms-threshold>` log messages include a
``remote`` field specifying client IP address.

``remoteOpWaitMillis`` Log Field
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Starting in MongoDB 5.0, you can use the :ref:`remoteOpWaitMillis
<log-messages-remoteOpWaitMillis>` log field to obtain the wait time for
results from :term:`shards <shard>`.

Define Variables Using the ``let`` Option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down