how does railway scale down?
Does anyone know if railway will destroy my running containers when scaling down. This helps me know if this is a solution that will work for apps using websocket connections.
44 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Could you explain what you mean? They talk about scaling up to handle more load in the docs I thought
On the Dev plan your project is seed onto a host with alot of resources depending on the projected usage, you can use upto 8gb of ram on the Dev plan for example
vertically not horizontally
Ye
On teams plan, do you get a dedicated host?
you can get up to 96vcpu and 256gb ram so i think so
So everything on railway is scaled vertically?
Dam, how does pricing work on that
For now yeah
Wyz has a little project that uses the internal API to scale but it's very experimental
How does that work for node apps? Do you run them using pm2 or some type of clustering?
You just right click on your project and import your repo to add more services
wdym
Some customers use envoy / nginx to proxy traffic between multiple services
we run all services as containers
If I want to host a next app with 96vcpu, node is single threaded and won’t even use those resources, next needs to be scaled horizontally to actually work well
Like you can run your website multiple times project to scale horizontaly
But it's very much a bad experience rn
yeah horizontal scaling is in the works 😁
Vercel is better and cheaper for frontends tbh
yeah we rec vercel for next tbh
Yeah but I wanted websockets support, I don’t want edge or lambda api endpoints
Vercel doesn’t support websockets from what I hear
ah
Yep, so you can manually spin up multiple instances of your website in a single project
But it's all very manual atm
tbh you only need like one instance
unless you have a massive userbase
Can I specify the max resource usage on the instance or does it just scale the container as needed?
Nope
You can use as much as you want ( within the limit of your account tier )
(starter, Dev, and teams)
So there's no need to manually adjust resource values
If that makes sense
Kind of, so if I have 8 different services running on my developer plan, does that mean each 8 services are capped at max 8gb or ram? Or is that 8gb shared for all 8 services?
That I don't know. I think it's per project like the 100gb of disk but I'm not sure
N*b any ideas?
Oh also if you insert cc the 500 a month limit is removed
No extra cost below 5 quid a month
Sorry for so many questions. I guess I’m just curious if I was going for a microservice approach, I don’t want 1 service alone consuming all the memory on an account limit causing my other services to be throttled or die. The docs really don’t explain much imo
Nah your good bro
But yeah, if the 8gb is not enough, be it shared or per service the teams plan is 20 quid and you get 32 GB of ram and 32 vcpu
Tbh based of that I would expect it to be per service
As 32gb of ram would not be enough for big customers
I think the wording here explains the limits. Each service (container) is capped at 512mb. The conflation of terminology between container and service is a bit confusing. Both my Postgres and next deployment are called services in the UI, but billing says container
a service is a description for creating containers ig
services have metadata and spawn containers
containers are where the code actually runs
The resources are shared across all of your running projects.
oh interesting? so you can only use 32gb on the teams plan?
Okay hold on. Now that I double-checked it, it's per container / service. So on Developer plan, you'll 8GB limit for each of your services.
oohh
where was that info btw
On the pricing page. It says: "Up to 8 GB RAM and shared CPU / container". That line break may seem to be confusing.
oh yea i see that
Ok so it basically spins up a docker container with max memory set to 8gb
kinda yeah
Getting Started | Nixpacks
App source + Nix packages + Docker = Image
Technically, no. Then they'd straight charge you for that 8GB reservation.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
right, so they probably monitor your container mem usage, and charge you based on that usage
but the container still probably has a max set to 8gb
or they just monitor your container and
docker update
it to more memory as they see it increase in memoryThat was what I was saying. Railway must not provision all 8GB to the service. It starts with maybe 1GB / 2GB, and instantiate more containers if required.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View