Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBM-1414 Documented changes in NumInsertionWorkers #227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions docs/reference/pbm-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/restore-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ The number of documents to buffer.
### restore.numInsertionWorkers

*Type*: int <br>
*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

Expand Down
18 changes: 14 additions & 4 deletions docs/usage/restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <backup_name> --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

Expand Down