17 days ago
Hi — the ephemeral storage docs seem to contradict themselves and I want to design around the right number.
The page (https://docs.railway.com/deployments/reference#ephemeral-storage) says:
"Every service deployment has access to 1GB of ephemeral storage on the Free plan and 100GB on a paid plan. If a service deployment consumes more than 10GB, it can be forcefully stopped and redeployed."
I'm on a paid plan. So which number can I actually rely on for files written to /tmp?
- Can I safely use up to ~100 GB, or
- Is 10 GB the real threshold where the deployment gets force-stopped?
If 10 GB is the enforcement line, what is the 100 GB referring to?
Context: I want to cache files on the ephemeral disk and need a safe cap to design around. Thanks!
Attachments
29 Replies
17 days ago
IIRC 100GB hard limit
But what is 10GB limit tho? Which limit actually gets applied? It is confusing
17 days ago
There is no 10GB limit, it's 100GB
17 days ago
@pepper - pretty please.
17 days ago
It's 100GB
17 days ago
Whoops. Sorry. I'll fix that real quick.
so as long as my server file system is under 100gb, i can cache as many files as i can in /tmp folder, is that right?
17 days ago
Correct
17 days ago
Though, that will likely change with runtime v3, as in ephemeral will be reduced.
17 days ago
Undetermined at this time.
It might be best to use a volume.
@Brody
question 1:
- is it also possible to attach volumes to railway sandboxes for running ai generated code on files that are in my volume?
- what about attachinhg the same ephemeral storage to railway sandbox that my server is using?
.
question 2: 100 gb volume costs $0.0156 per month if running nonstop, is that right?
Attachments
14 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 14 days ago
14 days ago
neither is possible, but you can use the sandboxes files API to inject all the files into sandbox, or just download it via a command from within the sandbox, read more here:
14 days ago
no, by my calculations, 100gb per month in a volume would cost: $15.5
-# 0.00000006 * 60 * 60 * 24 * 30 * 100
object storage is much chaper though
14 days ago
(also pls don't ping team members)
can i have persistent file system or volume attached to any future sandbox that gets created rather than fetching needed files inside sandbox every single time?
14 days ago
You can fork sandboxes, that way you initialize one sandbox filesystem and fork it into a new sandbox.
14 days ago
Hi there,
You can safely design around the 100GB cap.
The mention of "10GB" in those docs is a known legacy reference that has been superseded. On a paid plan, your service deployment has access to 100GB of ephemeral storage.
A quick piece of advice for your design:
Since you are planning to cache files in /tmp, remember that ephemeral storage is not persistent. Anything written to /tmp will be wiped whenever your service restarts, crashes, or redeploys to a new host.
If the files you are caching need to survive across redeployments or service restarts, I highly recommend using a Railway Volume instead of ephemeral storage. It will give you the persistence you need while keeping your storage architecture reliable.
Hope this helps you move forward with your design!
sorry but does it mean that if i wanna keep my file system for sandbox, i have to always have one sandbox running so that new ones can fork from it and have the same file system?
if all sandboxes stop running and i lose file system, right? So I have to pay for long running sandbox just to keep file system? If this is the case, it is gonna cost a lot I guess.
I couldn't find any info on sandbox pricing. I assume you still don't have since it is a new product.
Also out of curiosity, why not add support to be able to attach volumes to sandboxes?
14 days ago
If your goal is having a long running sandbox with a persistent file system, then I wouldn't recommend relying on forking. If something goes down, say an incident that causes sandboxes to go offline, then your filesystem disappears with it. It's not reliable
You could maybe look into checkpoints though, it's basically the same as forks but it persists even if the sandbox dies
-#
sandbox pricing:
- Memory: $50 GB / month
- vCPU: $50 vCPU / month
- Egress: $0.05 GB -#
I'm not sure why Railway doesn't support mountable files in sandboxes, sandboxes are a very new feature, so additional features might show up later
I don't wanna have long running sandbox. I was asking whether it is only way for having shared file system with other sandboxes: parent sandbox lives forever so that other sandboxes can fork from it??
12 days ago
you cant have a shared filesystem but yes you can inherit the files of other sandboxes via forking and checkpoints
and I'd recommend using checkpoints over forking for your usecase
11 days ago
if you use checkpoints then no you dont
11 days ago
of course, happy to help
Status changed to Solved medim • 10 days ago