NodeJS Scaling
So, I’ve seen people mentioning that you can have multiple instances of a deployment under the same project. While not exactly straight forward, it’s better then having multiple projects.
Now, how exactly do we do that? I can’t find anything related to that on the dashboard. Is it actually referring to using different environments as instances?
7 Replies
And how would load balancing be handled there when it comes to custom domains? Do we just handle it externally? Do we proxy to the railway project domain?
I think that what is meant is:
For each project, you can have multiple environments. Each environment can have its own services and plugins, which (I think) can be different between environments. Each service only has one active deployment (hooked up to the domain), but the previous deployment is kept alive until the current is deployed/healthcheck succeeds. Some people in the past have had issues with "ghost deployments", where previous deployments remain active for longer than they should, but I don't think that that's happened recently.
@aleks - I think what this user is referring to is throwing a reverse proxy for Horizontal Scaling.
@Xyo - yes, you would make a new service and make as many as you need, then route with NGINX or Cloudflare to route requests to that group of running services.
We should make a guide for this.
Hmm, are builds concurrent? 🤔
Cause if I were to have 10 separate services and they had to build in a sequence, that may cause issues with data
When you throw a commit to a repo that needs to be rebuilt, all services get a new build.
Yeah what I meant is, do they all build concurrently?
I'm coming from Vercel where concurrent build is a luxury haha
Yes
They do