We get asked questions about Fly in a lot of places on the web which we answer. But, not everyone is everywhere on the web, so with Fly Answers Questions, we bring those answers to you. If you have questions about Fly, why not ask @flydotio on Twitter, or drop a query in the Fly Community.
Q: I’d like to park my Fly application for a little while so it isn’t consuming resources. How can I do this without destroying the application and redeploying it later?
A: As you’ll have noticed, Fly applications stay running all the time ready to service your traffic. You can, as you say, destroy the application and redeploy it, but you’ll lose configuration with that process.
Which is why the fly suspend
command exists. Rather than destroy the app, it turns the number of instances — VMs running the app — down to zero. At this point the application is effectively not running, but all its status and settings are intact.
Bringing it back is a case of running fly resume
which initially brings back one instance to ensure all is well and then fully redeploys the application using its previous configuration.
Q: Followup question: what’s the restart
command then?
A: Well spotted. The fly restart
command is nothing to do with suspended applications. It doesn’t trigger any deployments either. What it does is go to each instance of your application and restart them in place. It’s useful for when your app may have got into an indeterminate state and you’d like to start as fresh as possible but without redeploying.
Q: I was looking at using Fly’s Redis support but got an error when I went to use the subscribe
command. What’s up with that?
A: Publish/Subscribe is not supported on Fly’s Redis implementation. It joins a small set of unsupported Redis commands. Most unsupported commands are related to server or client management. The PubSub commands, along with Redis scripting commands and the Geo-based Redis commands are currently not available.
Q: Can I set the minimum number of instances for an app to 0?
A: No, Fly applications will always have one or more instances running. If you want to go to 0, you have to suspend your application, see the first question for more on that.
Q: Isn’t the Fly CLI called flyctl
? You’ve been using the fly
command in these answers.
A: The answer to that is “Why not both?”. We’re slowly migrating the flyctl command to the quicker - to type and say - fly
command. When you install flyctl now, it creates a symlink from flyctl
to fly
and you can use either to run the command. Over time, we’ll move completely to the shorter command, with an eye to back-compatibility for your scripts.
That’s it for this Fly Answers Questions. Get your questions in on community.fly.io or on Twitter.
Community.fly.io
If you follow the links to community.fly.io, you will see that our new community site is a great place to ask questions, look for hints and tips and get your Fly apps running at their best. If you have a Fly account, sign in today. It’s easy as we’ve enabled single sign-on between Fly and the community site making it simple to participate.