Feasibility of Per-User Dynamic Container Architecture on Railway
teocns
PROOP

10 months ago

I'm exploring Railway for a project where I need to dynamically spin up and down containers on a per-user basis.
You're looking at a worker-queue desgin, and each user would get their own isolated container environment(s) that can be started as their queues fill up.

Some specific questions I have:

  • Is there a hard limit on the number of containers/services I can run simultaneously on Railway?

  • Can I programmatically create, start, and stop containers via an API?

  • Would Railway's pricing model work for this kind of dynamic scaling where containers might be frequently started/stopped?

  • Are there any architectural recommendations or limitations I should be aware of for this use case?

I'd appreciate any guidance on whether this approach is feasible with Railway or should I go with Kubernetes

13 Replies

teocns
PROOP

10 months ago

N/A


adam
MODERATOR

10 months ago

  1. As long as you're paying your bills, as far as I know no.

  2. Yes, using the Railway CLI https://docs.railway.com/guides/cli

  3. Define work? You are charged based on CPU, RAM, Networking, and Storage. The first 3 will only charge while the container is active, Storage will charge as long as you have an active volume.

  4. It's your project, you'll have to make the decisions there


passos
MODERATOR

10 months ago

and hey, as mentioned on the <#727689277219012669> I would recommend doing by project.
projects contains a limit of 100 per service, projects seems to be infinite.


teocns
PROOP

10 months ago

Thanks,
as @Brody mentioned there's a limit of 100 services per project. Should I create a new project on a per-user-signup basis to preallocate a dedicated worker containers? in this case, am I going to hit a wall in max number of projects per billing account?


adam
MODERATOR

10 months ago

There is no limit of projects by billing account. And again, do not ping the team or conductors


adam
MODERATOR

10 months ago

At this point, it would be best for you to build out a POC so you can understand the platform limitations for yourself.


adam
MODERATOR

10 months ago

You will not run into the project limit for a POC, so you will cross that bridge when you get to it


brody
EMPLOYEE

10 months ago

ideally, you dont build a product that requires spot instances per user, its just not easily scalable, but if you have to do it, yes you would need to do it in a new project for every user.


teocns
PROOP

10 months ago

I get you on that one - the only alternative is running docker-in-docker for sharing a resource pool. But im happy to hear project limitations won't be a concern.

if Railway also does well at image caching on its own container registry servers, and can achieve fast container spin-up times, I can actually see this working out well


echohack
EMPLOYEE

10 months ago

Hey teo, I'd also recommend you reach out to us via https://railway.com/pricing#, especially once you've had a chance to test out the platform a bit for your use case.

I think with this level of activity we'd be interested in finding more out about your use case. Let us know!


teocns
PROOP

10 months ago

FYI already hit the first unpleasant wall :/

ValueError: GraphQL Error: Whoa there pal! Only one project can be created per user every 30s. Try again in a sec


echohack
EMPLOYEE

10 months ago

These are all limits that we can move, but we need to find out more about your use case. Can you reach out to us?

https://cal.com/team/railway/work-with-railway


parmstar
EMPLOYEE

10 months ago

@teocns looking forward to chatting Tuesday. Any more info you can provide would be great - email or here works well.

@echohack and I will make sure we’ve gone through it ahead of Tuesday.


Loading...