How does pricing work with Replicas

I have an app that is getting a lot of traffice but I am not sure whats the perfect number of replicas for me. How do I know how many replicas I should use? What is the downside in having as many replicas as possible? (20 I think) How does pricing work with replicas?
17 Replies
Percy
Percy16mo ago
Project ID: N/A
Brody
Brody16mo ago
lets say your app costs a stable 4$ a month to run on one replica, if you set replicas at two railway runs two deployments, so if one replica costed 4$ a month, two will cost 8$ a month this is math in a perfect scenario, but i hope you get the idea as for the number of replicas to use, set it to 2, if that doesn't provide enough compute, increase it to three, and so on
oopsidaisy
oopsidaisy16mo ago
my understanding is that the pricing is on usage. $0.000231 / GB / minute for the memory. I think if I use 1 or 2 replicas, my GB used and the number of minutes is still the same. It is just that this usage is split between 2 instances instead of 1. So the what I pay should be the same in both cases. What am I getting wrong here?
Brody
Brody16mo ago
pricing is on usage yes, but two replicas will use twice as much usage as one replica, so you are charged double if one replica costs $4 then two replicas cost 8$
oopsidaisy
oopsidaisy16mo ago
But i am assuming im getting the same traffic and the same number of requests in both cases So usage should be the same no?
Brody
Brody16mo ago
no replicas are duplicate deployments if one replica costs $4 then two replicas cost 8$ again this is math in a perfectly static environment, your end costs of two replicas instead of one will either be a little higher or a little lower than double the costs of one replica
oopsidaisy
oopsidaisy16mo ago
$0.000231 / GB / minute for the memory. so what is doubling in this pricing? the GB or the time?
Brody
Brody16mo ago
the price is doubling because you are now running two deployments instead of one 4 + 4 = 8
oopsidaisy
oopsidaisy16mo ago
Yeah that is assuming I pay per replica and not for usage on a replica. My understanding is that I pay for usage on a replica
Brody
Brody16mo ago
yes you do pay for usage, and two replicas will use more resources than one replica
oopsidaisy
oopsidaisy16mo ago
so what resource is used more? the memory or the time? sorry for too many questions im trying to understand uit
Brody
Brody16mo ago
cpu and mem are doubled since you are running double the deployments, thus double the price
oopsidaisy
oopsidaisy16mo ago
The only way I can understand it is if there is a fixed memory needed to run each replica that doesnt depend on the traffic its getting. Because if I have 2 replicas, the usage on each one should be havled no?
Brody
Brody16mo ago
https://discord.com/channels/713503345364697088/1134532182522732565/1134535864341508206 like ive said a few times, the pricing may not be exactly double, but the cost of 2 replicas will always be more than 1 replica
oopsidaisy
oopsidaisy16mo ago
ok thank you!
Brody
Brody16mo ago
no problems
mushuw
mushuw16mo ago
@oopsidaisy Last time I checked, the load balancer uses simple round robin. So if you have 1000 requests coming in, each replica will get 500 each. And of course, your app will have some baseline vCPU and RAM cost.
Want results from more Discord servers?
Add your server