From 73af4da9d17c58c2d559eea96938035ed1f65989 Mon Sep 17 00:00:00 2001 From: Joseph Dougherty Date: Thu, 5 Dec 2024 16:55:32 -0500 Subject: [PATCH 1/3] DOCSP-44657-mongosync-latency-performance --- .../mongosync/mongosync-behavior.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source/reference/mongosync/mongosync-behavior.txt b/source/reference/mongosync/mongosync-behavior.txt index e33d56e48..a3e995a5d 100644 --- a/source/reference/mongosync/mongosync-behavior.txt +++ b/source/reference/mongosync/mongosync-behavior.txt @@ -369,6 +369,25 @@ progress. For more information on DDL operations, see :ref:`txn-prod-considerations-ddl`. +Network Latency +~~~~~~~~~~~~~~~ + +Network latency or long physical distances between migration components +can negatively affect sync speed. + +Latency between ``mongosync`` and destination shards + For each change event that ``mongosync`` applies, ``mongosync`` does + an extra roundtrip to its metadata stored on the destination. + +Latency between destination shards + For each change event that ``mongosync`` applies, it must access a + document that may live on a different shard. This can result in many + cross-shard transactions. + +Latency between a destination shards’ nodes + ``mongosync`` must use :writeconcern:`"majority"` writes, which + require acknowledgement from multiple nodes within a shard. + Learn More ---------- From 89268df2a180566b614d4a30ce8dad682d13e1a4 Mon Sep 17 00:00:00 2001 From: Joseph Dougherty Date: Tue, 10 Dec 2024 11:57:53 -0500 Subject: [PATCH 2/3] product/eng review --- .../mongosync/mongosync-behavior.txt | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/source/reference/mongosync/mongosync-behavior.txt b/source/reference/mongosync/mongosync-behavior.txt index a3e995a5d..b86991eab 100644 --- a/source/reference/mongosync/mongosync-behavior.txt +++ b/source/reference/mongosync/mongosync-behavior.txt @@ -376,17 +376,22 @@ Network latency or long physical distances between migration components can negatively affect sync speed. Latency between ``mongosync`` and destination shards - For each change event that ``mongosync`` applies, ``mongosync`` does - an extra roundtrip to its metadata stored on the destination. + For each operation on the source cluster, ``mongosync`` does two + roundtrips to the destination server. The larger the latency, the + slower the sync. Latency between destination shards - For each change event that ``mongosync`` applies, it must access a - document that may live on a different shard. This can result in many - cross-shard transactions. + Mongosync writes operations and updates its own metadata on the + destination cluster in batches in a transaction. This can result in + cross-shard transactions, which may be more costly if the shards are + far apart. + +Latency between the nodes of each individual replica set on the source or destination + ``mongosync`` uses :writeconcern:`"majority"` writes and + :readconcern:`"majority"` reads, which require acknowledgement from + multiple nodes in a replica set. If the majority of these nodes aren't + in the same region, there will be negative performance implications. -Latency between a destination shards’ nodes - ``mongosync`` must use :writeconcern:`"majority"` writes, which - require acknowledgement from multiple nodes within a shard. Learn More ---------- From c08bcc75e6144cee99061619e9e9e8378cfc4875 Mon Sep 17 00:00:00 2001 From: Joseph Dougherty Date: Tue, 10 Dec 2024 15:00:09 -0500 Subject: [PATCH 3/3] additional review --- source/reference/mongosync/mongosync-behavior.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/reference/mongosync/mongosync-behavior.txt b/source/reference/mongosync/mongosync-behavior.txt index b86991eab..af67e793a 100644 --- a/source/reference/mongosync/mongosync-behavior.txt +++ b/source/reference/mongosync/mongosync-behavior.txt @@ -381,16 +381,17 @@ Latency between ``mongosync`` and destination shards slower the sync. Latency between destination shards - Mongosync writes operations and updates its own metadata on the - destination cluster in batches in a transaction. This can result in + ``mongosync`` runs operations and updates its own metadata in batches + in a transaction on the destination cluster. This can result in cross-shard transactions, which may be more costly if the shards are far apart. -Latency between the nodes of each individual replica set on the source or destination +Latency between the nodes of any replica set on the source or destination cluster ``mongosync`` uses :writeconcern:`"majority"` writes and :readconcern:`"majority"` reads, which require acknowledgement from - multiple nodes in a replica set. If the majority of these nodes aren't - in the same region, there will be negative performance implications. + multiple nodes in a replica set, including shard-backing replica + sets. If the majority of these nodes aren't in the same region, there + will be negative performance implications. Learn More