You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+70Lines changed: 70 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -242,6 +242,76 @@ await gateway.listen(3000)
242
242
console.log('Cluster started with 4 workers')
243
243
```
244
244
245
+
#### Advanced usage: Cluster lifecycle and operations
246
+
247
+
Bungate’s cluster manager powers zero-downtime restarts, dynamic scaling, and safe shutdowns in production. You can control it via signals or programmatically.
248
+
249
+
- Zero-downtime rolling restart: send `SIGUSR2` to the master process
250
+
- The manager spawns a replacement worker first, then gracefully stops the old one
251
+
- Graceful shutdown: send `SIGTERM` or `SIGINT`
252
+
- Workers receive `SIGTERM` and are given up to `shutdownTimeout` to exit before being force-killed
253
+
254
+
Programmatic controls (available when using the `ClusterManager` directly):
0 commit comments