Skip to content
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6dee1ad
PCSM-312 connection pool size configurable
rasika-chivate Jun 26, 2026
4b296a5
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
9121a58
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
f7b32e5
Update parameters.md
rasika-chivate Jun 26, 2026
92d1de0
Merge branch 'PCSM-312-connection-pool-size-configurable' of https://…
rasika-chivate Jun 26, 2026
0212a70
Update parameters.md
rasika-chivate Jun 26, 2026
b15fe79
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
8b5e1be
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
7ced4cc
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
08541e1
Update parameters.md
rasika-chivate Jun 26, 2026
b8ded38
Merge branch 'PCSM-312-connection-pool-size-configurable' of https://…
rasika-chivate Jun 26, 2026
c98cae0
Update authentication.md
rasika-chivate Jun 26, 2026
08b52e8
Align maxPoolSize version marker with sample output
Copilot Jun 26, 2026
443ff3f
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
d3e1b95
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
25e3116
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
8b34dc6
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
f1256e5
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
21e4f65
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
767ed1f
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
98eb861
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
474cda1
Update authentication.md
rasika-chivate Jun 26, 2026
679a580
Merge branch 'PCSM-312-connection-pool-size-configurable' of https://…
rasika-chivate Jun 26, 2026
cb8cdf4
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
db467b4
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
6b71457
Update parameters.md
rasika-chivate Jun 26, 2026
c8e543e
Merge branch 'PCSM-312-connection-pool-size-configurable' of https://…
rasika-chivate Jun 26, 2026
12b4ec3
Update parameters.md
rasika-chivate Jun 26, 2026
8706aea
Update parameters.md
rasika-chivate Jun 26, 2026
e510a51
Update parameters.md
rasika-chivate Jun 26, 2026
f4929eb
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
cfad366
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
68bb56e
Potential fix for pull request finding
rasika-chivate Jun 26, 2026
c52a49f
Potential fix for pull request finding
rasika-chivate Jun 29, 2026
56a4fb9
Update docs/install/parameters.md
rasika-chivate Jul 3, 2026
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
87 changes: 87 additions & 0 deletions docs/install/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,90 @@
| `PCSM_REPL_WORKER_QUEUE_SIZE` | Defines the maximum number of replication events that each replication worker thread can queue before processing. | `5000` |
| `PCSM_REPL_BULK_OPS_SIZE` | Defines the maximum number of operations that can be grouped together into a single bulk apply batch during replication. | `5000` |


## MongoDB connection string

!!! admonition "Version added: 0.10.0"
Comment thread
rasika-chivate marked this conversation as resolved.

PCSM supports the MongoDB `maxPoolSize` connection string option, which controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool.

Check notice on line 55 in docs/install/parameters.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/parameters.md#L55

[Google.Acronyms] Spell out 'PCSM', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'PCSM', if it's unfamiliar to the audience.", "location": {"path": "docs/install/parameters.md", "range": {"start": {"line": 55, "column": 1}}}, "severity": "INFO"}

You can set this option in the source and/or target MongoDB connection strings using `--source` and `--target` command-line options or through the `PCSM_SOURCE_URI` and `PCSM_TARGET_URI` environment variables.
Comment thread
rasika-chivate marked this conversation as resolved.

### Syntax

Append `maxPoolSize` as a query parameter to your connection string:

Without existing query parameters:

~~~text
mongodb://host:port/?maxPoolSize=500
~~~

With existing query parameters:

~~~text
mongodb://host:port/?replicaSet=rs0&maxPoolSize=500
~~~

??? example "Example: maxPoolSize=500"

```{.bash data-prompt="$"}
Comment thread
Copilot marked this conversation as resolved.
$ pcsm --source='mongodb://rs00:30000/?maxPoolSize=500' --target='mongodb://rs10:30100' --log-level='debug'
```

Output
```{.text .no-copy}
2026-06-24 15:16:40.691 INF Percona ClusterSync for MongoDB v0.10.0 3eb82dd 2026-06-24_09:36_UTC
2026-06-24 15:16:40.692 INF Config: source client compressors: [snappy zstd zlib] s=connect
2026-06-24 15:16:40.692 INF Config: source client maxPoolSize: 500 s=connect
2026-06-24 15:16:40.711 INF Connected to source cluster [Percona Server for MongoDB 8.0.16-5]: mongodb://rs00:30000
2026-06-24 15:16:40.711 INF Config: target client compressors: [snappy zstd zlib] s=connect
2026-06-24 15:16:40.711 INF Config: target client maxPoolSize: 100 (driver default) s=connect
2026-06-24 15:16:40.724 INF Connected to target cluster [Percona Server for MongoDB 8.0.16-5]: mongodb://rs10:30100
2026-06-24 15:16:40.728 INF Checking Recovery Data for "pcsm" s=recovery
2026-06-24 15:16:40.729 INF Recovery Data not found s=recovery
2026-06-24 15:16:40.729 INF Starting HTTP server at http://localhost:2242
```

### How maxPoolSize works

Check warning on line 95 in docs/install/parameters.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/parameters.md#L95

[Google.Headings] 'How maxPoolSize works' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'How maxPoolSize works' should use sentence-style capitalization.", "location": {"path": "docs/install/parameters.md", "range": {"start": {"line": 95, "column": 5}}}, "severity": "WARNING"}

| **Configuration** | **Behavior** |
| --------------- | -------- |
| Not set | Driver defaults to **100** connections |
| `maxPoolSize=N` | Driver caps the pool at **N** connections |
| `maxPoolSize=0` | Removes the limit, allowing the driver to create as many connections as needed. |


??? example "Example: maxPoolSize not defined"

```{.bash data-prompt="$"}
Comment thread
Copilot marked this conversation as resolved.
$ pcsm --source='mongodb://rs00:30000' --target='mongodb://rs10:30100' --log-level='debug'
```

Output
```{.text .no-copy}
2026-06-24 15:15:04.503 INF Percona ClusterSync for MongoDB v0.10.0 3eb82dd 2026-06-24_09:36_UTC
2026-06-24 15:15:04.504 INF Config: source client compressors: [snappy zstd zlib] s=connect
2026-06-24 15:15:04.504 INF Config: source client maxPoolSize: 100 (driver default) s=connect
2026-06-24 15:15:04.525 INF Connected to source cluster [Percona Server for MongoDB 8.0.16-5]: mongodb://rs00:30000
2026-06-24 15:15:04.525 INF Config: target client compressors: [snappy zstd zlib] s=connect
2026-06-24 15:15:04.525 INF Config: target client maxPoolSize: 100 (driver default) s=connect
2026-06-24 15:15:04.533 INF Connected to target cluster [Percona Server for MongoDB 8.0.16-5]: mongodb://rs10:30100
2026-06-24 15:15:04.546 INF Checking Recovery Data for "pcsm" s=recovery
2026-06-24 15:15:04.546 INF Recovery Data not found s=recovery
2026-06-24 15:15:04.546 INF Starting HTTP server at http://localhost:2242
```
Comment thread
Copilot marked this conversation as resolved.

### Recommendations
Comment thread
Copilot marked this conversation as resolved.

For the best clone performance, size the connection pool to match or exceed the number of clone workers.

| Cluster | Recommended `maxPoolSize` |
| ------- | ----------------------------------- |
| Source | At least `--clone-num-read-workers` |
| Target | At least `--clone-num-insert-workers` |

When PCSM starts, it logs the effective `maxPoolSize` for both the source and target clients.

Check notice on line 133 in docs/install/parameters.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/parameters.md#L133

[Google.Acronyms] Spell out 'PCSM', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'PCSM', if it's unfamiliar to the audience.", "location": {"path": "docs/install/parameters.md", "range": {"start": {"line": 133, "column": 6}}}, "severity": "INFO"}

!!! note
`maxPoolSize` applies independently to each MongoDB server or `mongos` instance that the client connects to. It does not define a single global connection limit for the entire client.

Check notice on line 136 in docs/install/parameters.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/parameters.md#L136

[Google.Contractions] Use 'doesn't' instead of 'does not'.
Raw output
{"message": "[Google.Contractions] Use 'doesn't' instead of 'does not'.", "location": {"path": "docs/install/parameters.md", "range": {"start": {"line": 136, "column": 117}}}, "severity": "INFO"}
Loading