All Versions
- DSpace 7.x (Current Release)
- DSpace 8.x (Unreleased)
- DSpace 6.x (EOL)
- DSpace 5.x (EOL)
- More Versions...
...
First, is by adding the "exec_mode" and "instances" settings to your JSON configuration as follows. The "exec_mode" setting enables cluster mode, while the "instances" setting allows you to customize how many CPUs are available to PM2 ("max" = all CPUs, but you also can specify a number.)
Code Block | ||||
---|---|---|---|---|
| ||||
{ "apps": [ { "name": "dspace-ui", "cwd": "/full/path/to/dspace-ui-deploy", "script": "dist/server/main.js", "instances": "max", "exec_mode": "cluster", "env": { "NODE_ENV": "production" } } ] } |
Then, start (or restart) your site as normal (e.g. pm2 start dspace-ui.json
)
Alternatively, you can pass in the "-i" flag with either "max" or a number to tell PM2 to run in cluster mode across that many CPUs:
Code Block |
---|
# Start the "dspace-ui" app & cluster it across all available CPUs pm2 start dspace-ui.json -i max |
...