20 days ago
Hey, is it correct that the auto balancer with multiple instances from the service does not work with private domains?
I have something like this:
"http://${{scraper.RAILWAY_PRIVATE_DOMAIN}}:8080"
And it seems like only one instance is being called at all, second is idle.
I have read this: (here)[https://docs.railway.com/reference/scaling]
Load Balancing Between Replicas
If you are using multi-region replicas, Railway will automatically route public traffic to the nearest region and then randomly distribute requests to the replicas within that region.
And I wonder if it's true. It seems like a missed opportunity if it's really only working on the public endpoints.
3 Replies
20 days ago
Hello,
It works, but it works slightly different for private networking.
When your application performs a DNS lookup for the private domain, our DNS resolver will return as many IPs as you have replicas in a randomized order.
Your application must always call a different IP for every request, right now, I would suspect it's cached an IP or sorting the returned list.
Although, I noticed that right now you don't have any replicas defined.
Best,
Brody
Status changed to Awaiting User Response Railway • 20 days ago
20 days ago
Hey, is there any way to purge the cache with service list? Or force update it in any way?
I have disabled multiple instances because it was not working, I will enable it now
Status changed to Awaiting Railway Response Railway • 20 days ago
20 days ago
That would be something at your code's level, and unfortunately, we would not be able to assist with that.
Status changed to Awaiting User Response Railway • 20 days ago
Status changed to Solved jjablonski-it • 20 days ago
