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