From 1ff5232ab267dc4db81e6d9cf006b2f8f6b7e16c Mon Sep 17 00:00:00 2001 From: Anastasia Alexadrova Date: Wed, 13 Nov 2024 10:03:54 +0100 Subject: [PATCH] PBM-1414 Documented changes in NumInsertionWorkers modified: docs/reference/pbm-commands.md modified: docs/reference/restore-options.md modified: docs/usage/restore.md --- docs/reference/pbm-commands.md | 1 + docs/reference/restore-options.md | 4 ++-- docs/usage/restore.md | 18 ++++++++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/reference/pbm-commands.md b/docs/reference/pbm-commands.md index 63f425b..ce70f15 100644 --- a/docs/reference/pbm-commands.md +++ b/docs/reference/pbm-commands.md @@ -783,6 +783,7 @@ The command accepts the following flags: | `--with-users-and-roles` | Restores users and roles created in custom databases during selective restore. Use this flag with the `--ns` flag. Available starting with version 2.5.0.| | `-c`, `--config` | The path to the `mongod.conf` file | | `--num-parallel-collections`| Sets the number of collections to process in parallel during a specific logical restore. When undefined, `pbm-agent` processes the number of parallel collections defined for the `restore.numParallelCollections` configuration parameter. If that is undefined, the default number of collections is the half of the number of logical CPUs. Available starting with version 2.7.0.| +| `--num-insertion-workers-per-collection`| Specifies the number of insertion workers to run concurrently per collection. Increasing the number for large import may increase the speed of the import. Available starting with version 2.8.0.| ??? "Restore output" diff --git a/docs/reference/restore-options.md b/docs/reference/restore-options.md index 148f67e..5ce83b6 100644 --- a/docs/reference/restore-options.md +++ b/docs/reference/restore-options.md @@ -24,9 +24,9 @@ The number of documents to buffer. ### restore.numInsertionWorkers *Type*: int
-*Default*: 10 +*Default*: 1 -Specifies the number of insertion workers to run concurrently per collection. +Specifies the number of insertion workers to run concurrently per collection. ### restore.numParallelCollections diff --git a/docs/usage/restore.md b/docs/usage/restore.md index 807ef73..fbd09d7 100644 --- a/docs/usage/restore.md +++ b/docs/usage/restore.md @@ -115,19 +115,29 @@ To restore a backup, use the [`pbm restore`](../reference/pbm-commands.md#pbm-re ### Adjust memory consumption - Starting with version 1.3.2, Percona Backup for MongoDB config includes the restore options to adjust the memory consumption by the `pbm-agent` in environments with tight memory bounds. This allows preventing out of memory errors during the restore operation. + Percona Backup for MongoDB config includes the restore options to adjust the memory consumption by the `pbm-agent` in environments with tight memory bounds. This allows preventing out of memory errors during the restore operation. ```yaml restore: batchSize: 500 - numInsertionWorkers: 10 + numInsertionWorkers: 1 ``` The default values were adjusted to fit the setups with the memory allocation of 1GB and less for the agent. - !!! note - The lower the values, the less memory is allocated for the restore. However, the performance decreases too. + !!! important + + In version 2.8.0, the default number for the `numInsertionWorkers` parameter has changed. Verify your applications and adjust the configuration if needed. + + Starting with version 2.8.0, you can override the number of insertion workers for a specific restore operation. + + ```{.bash data-prompt="$"} + $ pbm restore --numInsertionWorkers 5 + ``` + + Increasing the number may increase the restore speed. However, increase the number of workers with caution, not to run into higher than expected disk and CPU usage. + ### Restore from a logical backup made on previous major version of Percona Server for MongoDB