Having some trouble with regional VMs and Multi Region postgres

Hey everyone,

I am LOVING fly.io so far. Excellent job.

I am having an issue every time I deploy my code base. Every time I deploy the codebase, it scales up to my 3 vms and excludes ord EVERY TIME. This is problematic because ord is my primary in the Multi Region postgres setup. Here is my current setup:

POSTGRES:
PRIMARY: ord
REPLICAS: sea, syd

VMs:
ord, sea, syd
backups: vin, and a few others.

Stack:
Elixir, Phoenix Live View, fly_postgres.

I would love any ideas on how best to prevent this from happening. My current solution is to simply scale my vms down to zero then scale back up to 3. In doing this, I get 1 of each of the three vms I have chosen.

Thank you!

This is a little hard to control with our current placement system. The best bet is:

fly regions backup ord sea syd

fly scale count 3 --max-per-region=1

The first command disables backup regions, which you definitely don’t need. The second limits how many VMs are allowed to run in each region.

That has to be the fastest response I have ever gotten lol. Much appreciated and I see how this will work. Thank you so much for answering!

1 Like