3 ms·
A reasonably priced serverless (kinda) setup is possible on Fly.io. Fly charges for a VM by the second, and when a VM is off, RAM and CPU are not charged (stor
by timenova 3y ago
A reasonably priced serverless (kinda) setup is possible on Fly.io.
Fly charges for a VM by the second, and when a VM is off, RAM and CPU are not charged (storage is still charged). They also allow you to easily configure shutting down machines when there are no active requests (right from their config file `fly.toml`), and support a more advanced method which involves your application essentially terminating itself when there's no work remaining, which kills the VM. When a new request arrives, it starts back up.
Here are the docs [0]. And here's a blog post on how to terminate the VM from inside a Phoenix app for example [1].
So essentially, you can write an app which processes multiple requests on the same VM (so not really serverless), but also saves costs when its not in use (essentially the promise of serverless).
[0] https://fly.io/docs/apps/autostart-stop/ https://fly.io/docs/apps/autostart-stop/
[1] https://fly.io/phoenix-files/shut-down-idle-phoenix-app/ https://fly.io/phoenix-files/shut-down-idle-phoenix-app/
- cyanf 3y agoThat’s an on-demand server, not serverless.