🆙
Lightward
  • 👉Start here
  • Context
  • Priorities: Recursive health
  • Product: Playing the game
    • 1. Load the game
    • 2. Play the game
      • How to play
      • When to stop
      • The customer's health is not your job
      • Don't sign up for custom work
    • 3. Save your game
      • 3a. Record what's new
      • 3b. Push the update
      • 3c. Prepare for next time
  • Publishing: Erring public
  • Glossary
    • Concepts
    • Applications
    • Sync
  • Technical
    • README
    • Screenshots
    • Cronitor
      • SSL certificate expiration warnings
    • Fly
      • Overview
      • Restarting apps
      • Fly ATC
      • Counting all org machines
      • Autoscaling
      • Environment variables
      • Deploys
        • Recovering from deploy failures
      • Rough edges
      • SSH
      • Unusual consoles
    • GitHub
      • Dependabot
    • Migrations
Powered by GitBook
On this page
  • Not-particularly-recommended path
  • Recommended path
  • Filtering by process group

Was this helpful?

Edit on GitHub
Export as PDF
  1. Technical
  2. Fly

Restarting apps

Not-particularly-recommended path

The normal route for this is fly apps restart $APP_NAME.

This works, but (as of this writing) it restarts Fly machines in serial — and the restart sequence halts if any machine fails to restart normally. (This stuff is documented in Rough edges.)

Recommended path

This command generates restart commands. If you copy and execute its output, you'll restart all of an app's Fly machines individually and in parallel. Watch for failures — it's on you to address them.

fly m list -q -a $APP | awk NF | awk '{ print "fly m restart " $1 " &;" }'

Or, because Isaac just found out about pbcopy:

 fly m list -q -a $APP | awk NF | awk '{ print "fly m restart " $1 " &;" }' | pbcopy

I couldn't get the above to work while also showing status/results of each restart, so this is Jed's version of it:

fly m list -q -a $APP | xargs -P500 -n1 fly m restart

Filtering by process group

fly m list -a $APP | grep $GROUP | awk NF | awk '{ print "fly m restart " $1 " &;" }'
PreviousOverviewNextCounting all org machines

Last updated 1 month ago

Was this helpful?