Load Balancer

can someone please help me on how LB works for the application which runs on two different regions?

May be this is helpful: High availability on Fly.io - #3 by kurt

Thank you @ignoramous I’ll have a look.

It’s not perfect, but the way it works is that it will attempt to route a request to an instance of an application in the nearest region to the entry point (where the request entered the fly network).

If you are using apps v2, it will event attempt to wake a stopped instance if there is one closer than a distant running instance, however this behavior is not predictable so I wouldn’t rely on it.

Assuming your service is stateless, you should just put apps in regions close to users and let the load balancer figure out what’s probably best, it does a decent job.

If your service is stateful then it gets a bit more complex. For example I’ve been playing with running multi-region databases on fly and I keep them as a private app, and have internet-facing services decide where to route based on known regions.

1 Like

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