Allow performing boot & start operations in groups

Adds top-level configuration options for `group_limit` and `group_wait`.
When a `group_limit` is present, we'll perform app boot & start
operations on no more than `group_limit` hosts at a time, optionally
sleeping for `group_wait` seconds after each batch.

We currently only do this batching on boot & start operations (including
when they are part of a deployment). Other commands, like `app stop` or
`app details` still work on all hosts in parallel.
This commit is contained in:
Kevin McConnell
2023-04-13 12:43:19 +01:00
parent bc8875e020
commit f530009a6e
5 changed files with 64 additions and 4 deletions

View File

@@ -831,6 +831,23 @@ mrsk lock acquire -m "Doing maintanence"
mrsk lock release
```
## Gradual restarts
When deploying to large numbers of hosts, you might prefer not to restart your services on every host at the same time.
MRSK's default is to start new containers on all hosts in parallel. But you can control this by configuring `group_limit` and `group_wait`.
```yaml
service: myservice
group_limit: 10
group_wait: 30
```
When `group_limit` is specified, containers will be started on, at most, `group_limit` hosts at once. MRSK will pause for `group_wait` seconds between batches.
These settings only apply when starting containers (using `mrsk deploy`, `mrsk app boot` or `mrsk app start`). For other commands, MRSK continues to run commands in parallel across all hosts.
## Stage of development
This is beta software. Commands may still move around. But we're live in production at [37signals](https://37signals.com).