Skip to content

Commit ec3edc6

Browse files
committed
fix: Clean up formatting in cluster management section of README
1 parent 1999287 commit ec3edc6

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ const cluster = new ClusterManager(
264264
workers: 4,
265265
restartWorkers: true,
266266
restartDelay: 1000, // base delay used for exponential backoff with jitter
267-
maxRestarts: 10, // lifetime cap per worker
268-
respawnThreshold: 5, // sliding window cap
267+
maxRestarts: 10, // lifetime cap per worker
268+
respawnThreshold: 5, // sliding window cap
269269
respawnThresholdTime: 60_000, // within this time window
270270
shutdownTimeout: 30_000,
271271
// Set to false when embedding in tests to avoid process.exit(0)
@@ -278,9 +278,9 @@ const cluster = new ClusterManager(
278278
await cluster.start()
279279

280280
// Dynamic scaling
281-
await cluster.scaleUp(2) // add 2 workers
282-
await cluster.scaleDown(1) // remove 1 worker
283-
await cluster.scaleTo(6) // set exact worker count
281+
await cluster.scaleUp(2) // add 2 workers
282+
await cluster.scaleDown(1) // remove 1 worker
283+
await cluster.scaleTo(6) // set exact worker count
284284

285285
// Operational visibility
286286
console.log(cluster.getWorkerCount())
@@ -297,11 +297,13 @@ cluster.sendSignalToWorker(1, 'SIGHUP')
297297
```
298298

299299
Notes:
300+
300301
- Each worker receives `CLUSTER_WORKER=true` and `CLUSTER_WORKER_ID=<n>` environment variables.
301302
- Restart policy uses exponential backoff with jitter and a sliding window threshold to prevent flapping.
302303
- Defaults: `shutdownTimeout` 30s, `respawnThreshold` 5 within 60s, `restartDelay` 1s, `maxRestarts` 10.
303304

304305
Configuration reference (cluster):
306+
305307
- `enabled` (boolean): enable multi-process mode
306308
- `workers` (number): worker process count (defaults to CPU cores)
307309
- `restartWorkers` (boolean): auto-respawn crashed workers

0 commit comments

Comments
 (0)