a year ago
Hi, just want to verify that for a single service there will only be one running container at any given time. The reason I ask is because in my svelte frontend i am storing user sessions in a writable (server-side) keyed by userId. This works great if there's just one container answering the horn but if there's a round-robin or some other load-balancing going on to multiple containers then users could be easily routed to a container with a writable store not containing their active session. If this is the case, I would need to rearchitect things to keep sessions in redis or postgres or something. However, if one node process (container) is what you get per service, then I can punt on this problem for now until I have to worry abuot much higher traffic levels. Thanks!!
11 Replies
a year ago
By default, one service is one container.
a year ago
https://docs.railway.com/overview/advanced-concepts#deploy-options
Replicas: By default, your deployment will go out with a single instance. With replicas, you have the ability to scale up your deployment instances.
Great! but the docs don't say how to set this up in a nixpacks.toml file… any clue there?
at this point this is just for reference… i decided to move my session mgmt to postgres rather than redis. it's a bit more traffic-heavy but i'll live with it for now
a year ago
set what up exactly?
i mean, how do you configure for more than a single container/instance per service? (if that's what you want)
a year ago
Service > Settings > Deploy > Choose Region and the amount of instances for a region
Ah! Excellent. Will use that control then. Thanks a bunch. You can close this!
a year ago
thank you uxuz!
a year ago
!s
Status changed to Solved brody • about 1 year ago