I am new to using fly. I’ve managed to get my vapor (Swift) server running on fly but I get this:
2024-08-06T19:30:22.702 app[1857597a473198] sjc [info] INFO Main child exited normally with code: 0
2024-08-06T19:03:20.942 app[1857597a473198] sjc [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2024-08-06T19:03:20.943 app[1857597a473198] sjc [info] [ 416.125459] reboot: Restarting system
This happens every 10 or so minutes. Why is the server exiting? What’s the best way to go about debugging this? Any push in the right direction would be greatly appreciated.
Also in the dashboard it shows 2 machines. I only have one server. Is this normal?
I believe the default is for the Fly proxy to scale to 0 and generally the scale down period is around 10mins in my experience.
If you want to keep a certain number of machines running or prevent scaling, you can adjust the following properties in your fly.toml’s services/http_service section: min_machines_running, auto_stop_machines, auto_start_machines.
Thanks for the response! The min_machines was set to 0, so does this mean the machines will stop until the min_machines is reached? I’m changing min_machines to 1 and auto_stop_machines to false.
That’s correct. Assuming no usage via the Fly proxy endpoint, it will scale down until it reaches min_machines_running.
Just be aware that if you set auto_stop_machines to false, but still have auto_start_machines set to true, it will only scale up and never back down (assuming you still have more than one machine).
If you only ever need one machine, you can run the following: