containers per single service?
willkessler
HOBBYOP

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!!

Solved

11 Replies

willkessler
HOBBYOP

a year ago

7ff52821-b7d2-459c-bff8-3f070394a82b


uxuz
MODERATOR

a year ago

By default, one service is one container.


uxuz
MODERATOR

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.


willkessler
HOBBYOP

a year ago

Great! but the docs don't say how to set this up in a nixpacks.toml file… any clue there?


willkessler
HOBBYOP

a year ago

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


brody
EMPLOYEE

a year ago

set what up exactly?


willkessler
HOBBYOP

a year ago

i mean, how do you configure for more than a single container/instance per service? (if that's what you want)


uxuz
MODERATOR

a year ago

Service > Settings > Deploy > Choose Region and the amount of instances for a region


willkessler
HOBBYOP

a year ago

Ah! Excellent. Will use that control then. Thanks a bunch. You can close this!


brody
EMPLOYEE

a year ago

thank you uxuz!


brody
EMPLOYEE

a year ago

!s


Status changed to Solved brody 12 months ago


Loading...