Service replicas
tristonplummer
TRIALOP

2 years ago

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

21 Replies

tristonplummer
TRIALOP

2 years ago

d230d706-2f0e-433a-86c2-22bc6ec11f55


2 years ago

You can create replicas in your service settings

1282328177380823000


2 years ago

individual replica addresses are exposed via a AAAA DNS lookup, example -

So with this list you can implement your own load balancer logic, or use caddy to handle this for you, example -


tristonplummer
TRIALOP

2 years ago

Much appreciated!


2 years ago

no prob, let me know if you have any more questions!


shubhankartrivedi
HOBBY

a year ago

can you explain more on this?


a year ago

what would you like explained?


shubhankartrivedi
HOBBY

a year ago

I just need a doc about replicas in detail


a year ago

what information are you seeking?


shubhankartrivedi
HOBBY

a year ago

related to how I can setup custom load balancing if I have replicas


shubhankartrivedi
HOBBY

a year ago

ik by default it uses round-robin


a year ago

is round robin not desirable?


shubhankartrivedi
HOBBY

a year ago

yep, i want to do something like "active" & "inactive" state


shubhankartrivedi
HOBBY

a year ago

so new visitors will go to an "inactive" state and then it's flagged "active"


shubhankartrivedi
HOBBY

a year ago

then after some coding logic, it is set back to "inactive" and ready for use


a year ago

what would be the use case for this?


shubhankartrivedi
HOBBY

a year ago

ahh you're asking soo many questions


shubhankartrivedi
HOBBY

a year ago

i'm gonna answer later cuz busy


a year ago

no worries at all, sorry for all the questions but the answers help me to deliver a better response 🙂


shubhankartrivedi
HOBBY

a year 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?


a year ago

there is this tutorial for proximity steering https://docs.railway.app/tutorials/proximity-steering


Loading...