Service replicas
Hello
Just wondering if there’s any way to address a specific replica for a service? My use case is that I’d like to perform my own sort of load balancing and would like to tell an end user which replica they should connect to.
Kind regards
Triston
Solution:Jump to solution
individual replica addresses are exposed via a AAAA DNS lookup, example - https://utilities.up.railway.app/dns-lookup?value=hello-world.railway.internal&type=ip
So with this list you can implement your own load balancer logic, or use caddy to handle this for you, example - https://github.com/railwayapp-templates/caddy-reverse-proxy/blob/main/Caddyfile...
18 Replies
Project ID:
d230d706-2f0e-433a-86c2-22bc6ec11f55
d230d706-2f0e-433a-86c2-22bc6ec11f55
You can create replicas in your service settings
Solution
individual replica addresses are exposed via a AAAA DNS lookup, example - https://utilities.up.railway.app/dns-lookup?value=hello-world.railway.internal&type=ip
So with this list you can implement your own load balancer logic, or use caddy to handle this for you, example - https://github.com/railwayapp-templates/caddy-reverse-proxy/blob/main/Caddyfile
Much appreciated!
no prob, let me know if you have any more questions!
can you explain more on this?
what would you like explained?
I just need a doc about replicas in detail
what information are you seeking?
related to how I can setup custom load balancing if I have replicas
ik by default it uses round-robin
is round robin not desirable?
yep, i want to do something like "active" & "inactive" state
so new visitors will go to an "inactive" state and then it's flagged "active"
then after some coding logic, it is set back to "inactive" and ready for use
what would be the use case for this?
ahh you're asking soo many questions
i'm gonna answer later cuz busy
no worries at all, sorry for all the questions but the answers help me to deliver a better response 🙂
@Brody okay I know that railway uses round-robin by default but I wanna use my custom system for load-balancing on replicas.
Is there is any blog or doc for this?
there is this tutorial for proximity steering https://docs.railway.app/tutorials/proximity-steering