Self-hosted Anvil, function calls go to a single uplink only

This is the old behavior.

Now the Anvil server does some load balancing by (I think) randomly picking one of the registered uplink scripts.

See here: Multiple Uplinks To Same App - #11

I have 3 uplink servers and I use the machine name suffix to always call server1 if it’s available, if that’s busy I call server2, if that’s busy I call server3. If they all are busy I wait for them to be available. (The script uses resources that cannot be managed by two concurrent scripts on the same machine, and exits immediately if it receives a request while it’s already processing another one).

This allows me to always go to server1 and check if there is a problem because that’s the one most likely to process the requests.

If the self-hosted server still has the old behavior, you can simulate a load balancing by using unique names for the functions and randomly picking one of them. The problem is that if one of them is down, you only know it after the call fails. And when that machine is back up, you only know if you try to call it.

2 Likes