The main thing that matters about my app is the fact that users are as close to the server as possible.
I use Fly because it is the easiest way to get an app deployed in multiple regions.
Currently, I have the Pro plan on Fly and I have it set it up so that all regions are available. I set the minimum count to 20.
I have encountered 2 problems:
Instead of 1 deployment per region, I see multiple deployments in the same region. Can I set the limit to 1 deployment per region?
My users have their requests sent to regions that are not the closest one for them. For example, I am in California and rather than sending me to any of the 3 deployments in California, my traffic is routed to New Jersey or even Chicago sometimes. Is there a way to make sure that the server that my user’s traffic hits is one that is closest to them?
Can you copy paste the output of flyctl scale show and flyctl regions list?
Generally speaking you will be routed to whatever region is closest network topology wise. This probably means that for whatever reason ewr or ord have a lower latency from your network. Check out this page: https://liveview-counter.fly.dev/. If you scroll to the bottom it will show you the region that you are connected to by default with the latency shown.
You can pass max per region to the scale command: fly scale count 15 --max-per-region=1. Just make sure you have enough regions enabled for the count you’re requesting. You’ll also need to use fly deploy --strategy rolling with that setting.
https://debug.fly.dev will have a better look at what routing is doing for you. You’ll see a Fly-Region header that indicates the region we saw your connection in.