feat(cli): servers and workers in cluster mode (#13601)

* feat(cli): servers and workers in cluster mode

* allow percentage
This commit is contained in:
Carlos R. L. Rodrigues
2025-09-28 05:06:18 -03:00
committed by GitHub
parent cbfe0a4e95
commit 9d8ed70130
3 changed files with 86 additions and 8 deletions

View File

@@ -416,9 +416,19 @@ function buildLocalCommands(cli, isLocalProject) {
: `Set port. Defaults to ${defaultPort}`,
})
.option(`cluster`, {
type: `number`,
type: `string`,
describe:
"Start the Node.js server in cluster mode. You can specify the number of cpus to use, which defaults to (env.CPUS)",
"Start the Node.js server in cluster mode. Specify the number of CPUs to use or a percentage (e.g., 50%). Defaults to the number of available CPUs.",
})
.option("workers", {
type: "string",
default: "0",
describe: "Number of worker processes in cluster mode or a percentage of cluster size (e.g., 25%).",
})
.option("servers", {
type: "string",
default: "0",
describe: "Number of server processes in cluster mode or a percentage of cluster size (e.g., 25%).",
}),
handler: handlerP(
getCommandHandler(`start`, (args, cmd) => {