docs: docs for next release (#13621)
* docs: docs for next release * changes to opentelemetry dependencies * document plugin env variables * document admin changes * fix vale error * add version notes * document campaign budget updates * document campaign changes in user guide * document chages in cluster mode cli * documented once promotion allocation * document multiple API keys support
This commit is contained in:
@@ -65,19 +65,66 @@ npx medusa start
|
||||
<Table.Row>
|
||||
<Table.Cell>
|
||||
|
||||
`--cluster <number>`
|
||||
`--cluster <string> [--workers <string>] [--servers <string>]`
|
||||
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
|
||||
Start Medusa's Node.js server in [cluster mode](https://expressjs.com/en/advanced/best-practice-performance.html#run-your-app-in-a-cluster). Running in cluster mode significantly improves performance as the workload and tasks are distributed among all available instances instead of a single one.
|
||||
Start Medusa in cluster mode. Learn more in the [Starting Medusa in Cluster Mode](#starting-medusa-in-cluster-mode) section.
|
||||
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
|
||||
Cluster mode is disabled by default. If the option is passed but no number is passed, Medusa will try to consume all available CPU cores.
|
||||
Cluster mode is disabled by default. If the option is passed but no number or percentage is passed, Medusa will try to consume all available CPU cores.
|
||||
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</Table>
|
||||
|
||||
---
|
||||
|
||||
## Starting Medusa in Cluster Mode
|
||||
|
||||
<Note>
|
||||
|
||||
Prior to [Medusa v2.11.0](https://github.com/medusajs/medusa/releases/tag/v2.11.0), the `--cluster` option accepted a number value only. You can now pass either a number or a percentage value, and you can also specify the number of servers and workers.
|
||||
|
||||
</Note>
|
||||
|
||||
Medusa supports starting the Node.js server in [cluster mode](https://expressjs.com/en/advanced/best-practice-performance.html#run-your-app-in-a-cluster), which significantly improves performance as the workload and tasks are distributed among all available instances instead of a single one.
|
||||
|
||||
Cluster mode is disabled by default. To enable it, pass the `--cluster` option when starting Medusa:
|
||||
|
||||
```bash
|
||||
npx medusa start --cluster
|
||||
```
|
||||
|
||||
When the `--cluster` option is passed without a number or percentage value, Medusa will try to consume all available CPU cores.
|
||||
|
||||
### Specify Number or Percentage of CPU Cores
|
||||
|
||||
You can specify the number or percentage of CPU cores to be used by passing a number or percentage value to the `--cluster` option:
|
||||
|
||||
```bash
|
||||
npx medusa start --cluster 2 # Use 2 CPU cores
|
||||
npx medusa start --cluster 50% # Use 50% of available CPU
|
||||
```
|
||||
|
||||
### Specify Number of Servers and Workers
|
||||
|
||||
When running Medusa in cluster mode, you can specify the number or percentage of instances that are [servers or workers](!docs!/learn/production/worker-mode) by passing the `--servers` and `--workers` options:
|
||||
|
||||
```bash
|
||||
npx medusa start --cluster 4 --servers 25% --workers 75% # Use 4 CPU cores, with 25% as servers and 75% as workers
|
||||
npx medusa start --cluster 4 --servers 1 --workers 3 # Use 4 CPU cores, with 1 as server and 3 as workers
|
||||
npx medusa start --cluster 4 --servers 1 --workers 1 # Use 4 CPU cores, with 1 as server and 1 as worker (the remaining 2 will run in shared mode)
|
||||
```
|
||||
|
||||
When the number or percentage of servers and workers don't add up to the total number of instances in cluster mode, the remaining instances will run in shared mode.
|
||||
|
||||
<Note>
|
||||
|
||||
Learn more in the [Worker Mode](!docs!/learn/production/worker-mode) guide.
|
||||
|
||||
</Note>
|
||||
Reference in New Issue
Block a user