Fly Machines - Create and forget and limitations?

I am trying to use 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?

  1. Can I run as many machines as I need? Are there any “create” machine HTTP API endpoint restrictions (e.g., rate limits)?
  2. Do I need to delete these machines after they are stopped? If I don’t need to delete them, do 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)?

Thank you for any help!

No (publicly advertised) per-org limit per se, but one could run into limits due to capacity issues: Question about machine limits and creation - #2 by JP_Phillips

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).

1 Like

Thank you for your swift reply!

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.

This is an existing feature: Fly machines automatically delete? - #2 by JP_Phillips


Wow! Thank you. Would be cool to have this in the Fly docs or I overlooked it… Either way, great!

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.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.