Fly Machines are VMs with a fast REST API that can start up a new instance in about 300ms.
Our proxy can start Fly Machines for you, and you can shut them down when they’re idle. Which means you can cost-effectively create pools of VMs and keep them standing by ready to handle new requests.
If you’re already running an app on Fly.io, here’s what you need to know. Machines are basically the same as the VMs we manage with our orchestration system (Nomad). When you deploy an app, we create new VMs and destroy the old ones with your preferred image. Fly Machines are one level lower, and let developers manage individual VMs.
We built Machines for us. Our customers want their apps to scale-to-zero, mostly to save money. Also because it feels right. An app that isn’t doing anything shouldn’t be running.
I’m trying fly machine by just looking at fly m --help. It looks like I must have a docker image on a public repository as the command to run fly machine is flyctl machine run <image> [command] [flags]. There’s also the --dockerfile option. So I wonder if it’s (or, will it be, in the future) possible to deploy a fly machine from just a Dockerfile (similar to an app.)
But you can still run your own builds and push to the Fly registry, where your builds are only visible to you and our servers. To do that, you’d need to create an app, then fly auth docker, and finally, push to registry.fly.io/your-app-name:some-tag. Using this image with fly machine run works.
Hi, as mentioned in the article “fly deploy” is not available. Does it mean that the deployment isn’t rolled out in Blue/Green fashion? How does it behave? You also mentioned a fixed cost of $0.15/mo for a 1GB Docker image. This is costly for object storage. It kills a bit the idea of designing a FaaS with Fly.io Machines. Imagine, you’re running 10K functions. You would have idle costs of around $1500. I understand that maintaining a state isn’t for free but it should be billed per usage.
Could you tell me more about how a dockerfile can be built remotely and do we profit from a build cache?
10K functions, all 1G in size? Compiled languages like C/PP, Golang, D, and Rust can be bundled in tiny distroless / alpine runc images (10M+). That’s 10K instantly launchable functions for $15/mo.
One could also terminate destroy machines to rid of unused functions, than keep them around, to optimise for costs further. This will, though, increase machine start time, when a request to the now terminated destroyed function does need to be served. Tricky.
Though, I agree Fly needs to rethink its pricing as it doesn’t “scale” for large customers with a lot of idling functions.
I think you have never worked with NPM 1GB is the worst case but 300-700MB are pretty common. We can not ensure that customers have their images optimized to the last bit.
Well true, npm can result in absurd sizes but you can get rid of much of it. Like by using nm-prune - npm before a deploy. If you were to provide it to customers you could specify a sensible yet still generous max size. Cloudflare and AWS do, so it’s entirely reasonable.
That’s fair. When are images deleted? How much would it cost to deploy ten revisions per month with an average image size of 100MB? Will it still cost me $0.15, or how many images are kept warm?
Ah, so the config flag is misleading. It doesn’t actually work here. Machine config may only be done through the available command line arguments, or via the API.
Wait, why won’t flyctl m run --config <fly.toml> ... work when it is documented as a valid cli arg? Or, you mean to say that in this instance it should be flyctl m start --config <fly.toml> ... instead?
You’re actually only paying for machines that you’ve created and left stopped. That’s “warm” right now. You can totally just destroy machines and create new ones when you need to, which will pull the Docker image from our registry and boot the thing up.
This is very exciting functionality - I finally got around to signing up to Fly (which I’d intended to do for a while) to try it out.
It works great for sizes up to shared-cpu-8x, but when I attempt to use any dedicated CPU option (e.g. dedicated-cpu-1x) I get this:
Error could not launch machine: insufficient CPUs available to fulfill request
Is this perhaps a restriction on my new account? Or a temporary limitation of the new service? I tried in syd, sin and iad regions. EDIT: I just tried depositing $25 in my account and that doesn’t seem to have changed it.