R
Railway2mo ago
Triston

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:
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...
Jump to solution
18 Replies
Percy
Percy2mo ago
Project ID: d230d706-2f0e-433a-86c2-22bc6ec11f55
Triston
Triston2mo ago
d230d706-2f0e-433a-86c2-22bc6ec11f55
Fragly
Fragly2mo ago
You can create replicas in your service settings
No description
Solution
Brody
Brody2mo ago
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
Triston
Triston2mo ago
Much appreciated!
Brody
Brody2mo ago
no prob, let me know if you have any more questions!
Pharoh
Pharoh3w ago
can you explain more on this?
Brody
Brody3w ago
what would you like explained?
Pharoh
Pharoh3w ago
I just need a doc about replicas in detail
Brody
Brody3w ago
what information are you seeking?
Pharoh
Pharoh3w ago
related to how I can setup custom load balancing if I have replicas ik by default it uses round-robin
Brody
Brody3w ago
is round robin not desirable?
Pharoh
Pharoh3w ago
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
Brody
Brody3w ago
what would be the use case for this?
Pharoh
Pharoh3w ago
ahh you're asking soo many questions i'm gonna answer later cuz busy
Brody
Brody3w ago
no worries at all, sorry for all the questions but the answers help me to deliver a better response 🙂
Pharoh
Pharoh7d ago
@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?
jeremy
jeremy7d ago
there is this tutorial for proximity steering https://docs.railway.app/tutorials/proximity-steering
Want results from more Discord servers?
Add your server