Any reason not to create a machine for every region and just leave the ones you don't want stopped?

I’m wondering if there would be any issues with creating a machine for every region but leaving it in a stopped state if I don’t need that region right now. Will this cause any problems for Fly if a lot of apps do this? Creating a machine is pretty fast, but just having a stopped one ready to go is probably faster, if I end up needing it, right?

Basically, should I treat machines more on the pets side of the spectrum, or more on the cattle side of the spectrum?

Hi,

I mean you could

Personally I would think it is more a question of the problems it would create for you :thinking:. Regions will have random issues (e.g Fly.io Status - Upstream network connectivity issues in JNB). If such an issue prevents your app from deploying there (and it’s a region that you are not using and perhaps won’t ever) … that doesn’t seem ideal. Especially if that stops a deploy to other regions (to prevent them being out of sync with the version). Depends what trade-off you’d prefer.

1 Like

Thanks for replying Greg!

I’m a bit confused still about what you mean, though maybe you’re thinking about deploying with flyctl and I’m thinking about the machines API.

If a region has a random issue, wouldn’t that have similar effects whether I have 20 machines (1 in each region) with 15 stopped and 5 started, versus just having the 5 machines I’m actually using?

i.e. if there’s an issue in a region, sure I won’t be able to deploy in that region, but I can still deploy a machine in every other region. I can see how that would be a downside if my code calling the API can’t handle one machine failing to deploy amongst a group though, is that what you mean? Or is there something else I haven’t considered yet?

No problem.

Yep, I was assuming flyctl deploy. So my thought may well not be correct or even applicable :slightly_smiling_face:.

To clarify, I was assuming … you deploy. One region is down. 19/20 regions get v2. 1/20 can’t. It’s left with v1. Fly-bot has a think about the situation. Rather than shrug Fly-bot would say, hmm, the deploy (in total) hasn’t succeeded. And so rolls back to v1, making sure that 20/20 regions are consistent. But if you are only using say 3/20 of those regions, that would be silly. Your deploy would be blocked because it can’t deploy to a region you are not even using.

1 Like

That makes perfect sense, thanks for clarifying!

1 Like

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