-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update machine concurrently when using immediate strategy (#2845)
* Update machine concurrently when using immediate strategy Previously, we ran the machine update api calls sequentially when using `fly deploy --strategy immedate`. This can still be slow when there are lots of machines to update, say 30 or 100 or even more. Now, we default to running the machine updates concurrently when using `fly deploy --strategy immediate`. The default is kick off 16 machine update calls, wait for those to finish, then do another 16, wait, and so on until all machines are updated. The new `--immediate-max-concurrent` flag may be used to set a different size. For example, `fly deploy --strategy immediate --immediate-max-concurrent 64` will run 64 machine updates concurrently, wait, and so on. I tested this on a modest 35 machine cluster. This resulted in a pretty decent speed up. The results were: | fly version | fly deploy flags | Time | |---|---|---| | flyctl v0.1.97 | --strategy immediate | 30-40 seconds | | this pr | --strategy immediate | 8-15 seconds | | this pr | --strategy immediate --immediate-max-concurrent 35 | 5-6 seconds | * Use chan slice so we can continuously have up to --immediate-max-concurrent machine updates going * oops still need the wait group so they all finish, but now we only wait once at the very end
- Loading branch information
Showing
3 changed files
with
130 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters