restarts seem to sometimes not work?

hello! I have a website ( that I restart every 30 minutes with a cron job. Sometimes it gets into a state where the site doesn’t work (and is extremely slow) and running flyctl restart mess-with-dns doesn’t seem to fix it. Doing a flyctl deploy generally fixes the problem.

I’m having trouble reasoning about why this could be – I’m not making any changes to the code myself. I haven’t had a chance to dig deep into what’s going on yet so apologies if this doesn’t make much sense.

Restarts are a little unintuitive. They restart the process in place. vm stop and deploy both replace the VM entirely. It would be better to use vm stop for what you’re doing, probably.

A restart should do what you want, though. We’ll have a much better method for doing this soon. :slight_smile:

amazing, thank you! I thought a restart replaced the VM for some reason

1 Like

I probably told you that. It’s supposed to reset the rootfs when you restart, but it doesn’t replace the network adapter or anything.

replacing the rootfs seems good enough to me though – why would might flyctl restart be problematic in that case?

Oh yes, it is good! That’s what we want. But continued failures after restart might mean we’re not cleaning that up like we expected.

Also, how do I get the ID of a VM to use with flyctl vm restart <vm-id>? I don’t see VM IDs anywhere, though I’m probably missing something obvious.

fly status will show you the IDs. fly status --all will show you IDs for old ones, as well, if you ever need those.

1 Like