I am trying to use Fly.io Machines as a “FaaS” (function as a service).
An example use case, I imagine, is converting files on demand. The machine would run as long as the converting process takes time. Afterward, when the process is finished, the machine switches to the “stopped” state, which shouldn’t increase any bill.
What are the limitations of Fly Machines?
Can I run as many machines as I need? Are there any “create” machine HTTP API endpoint restrictions (e.g., rate limits)?
Do I need to delete these machines after they are stopped? If I don’t need to delete them, do Fly.io automatically delete them after some time? I assume it doesn’t cost money to have like 1000 machines stopped…
In other words, can I scale to infinity without worrying (creating machines and ignoring everything afterward)?
You can opt to delete them, but subsequent starts of the machines (using the same image) won’t be as quick. As of today, Fly doesn’t charge for stopped machines, but that might change. The indication back then was, Fly would charge for the disk space consumed by the stopped machine’s docker image (to the tune of $0.15/GB-month).
Thank you - that is good to keep in mind!
In my case, though, I don’t care about wasting some seconds (the container runs longer, so wasting some seconds isn’t bad for me)…
Well - just to be safe - I think I will delete the container after it has been stopped. Still, it sucks to have another potential “point of failure”… It would be great if Fly would provide an option to delete it automatically, so I don’t have to worry about this.
Sorry we haven’t updated the docs yet. The CLI changes were in a pre-release build for a while as we were working on the new version for Apps/deploying. It also looks like the flag got lost in the shuffle so we’ll get it added back soon. If you’re using the API directly, the auto_destroy does what you’d want.