8 months ago
hi, i'm using railway for N8N workflows
right now i have 4 workflows which none of them is active right now, just unfinished projects. not much nodes.
but my memory is very high, i have tried to upload / download some images accidentaly to local. it seems it stores in railway, how do i clear the disk / memory ?
74 Replies
8 months ago
1. Understand What’s Using Memory/Disk
• Memory (RAM): Used for currently running processes. If no workflows are active, memory usage should be minimal.
• Disk (Storage): N8N can save files (like images) in temporary folders (e.g., /tmp or a volume you configured).
Since you mentioned accidentally uploading/downloading images, this likely contributes to disk, not memory, unless you’re processing huge data in-memory.
2. Clear Temporary Files
If N8N is storing files locally inside the container (e.g., image files, temp exports), here’s what to do:
Option A: Redeploy / Restart the Service
• Railway containers are ephemeral. Restarting your service or redeploying it will usually reset the file system.
• On Railway:
• Go to your N8N service
• Click the three dots (⋮) → Redeploy
• This will kill the current instance and start a new one with a clean state (unless you’re using persistent storage volumes).
Option B: Add a Custom Cleanup Node in a Workflow
• You can create a temporary N8N workflow to:
• Use the Execute Command node
• Run: rm -rf /tmp/* or rm -rf ./files/* depending on where files are stored.
• Then disable/delete the workflow afterward.
3. Check If You’re Using Persistent Volumes
Railway allows Persistent Storage:
• If you’re using a volume, files remain across restarts.
• Go to your Railway service settings → Check if persistent volumes are mounted.
• You may:
• Go into the terminal (Railway > Service > Shell) and manually delete files
• Or delete the volume if you don’t need the files.
4. Monitor Resource Usage
• Use Railway’s built-in Metrics tab to see CPU, memory, and disk trends.
• Check for:
• Memory leaks (e.g., improperly handled large JSON blobs, looping workflows)
• Or workflows storing too much to disk
8 months ago
There's not much you can do about optimizing n8n resource usage besides enabling serverless, it all depends on what workflows you are running and according to the metrics you showed just the disk usage seems a bit high.
You have two ways of clearing your volume
If you wanna prevent data loss: Using the FileBrowser template and deleting your uploaded files (remember to follow the template instructions)
If you don't care about the volume data: You can wipe it by right-clicking on the volume -> disconnect volume -> click on it -> settings -> scroll down -> wipe volume -> reattach volume to the service -> redeploy service
Thanks ! I'll try no.1
Well if i do no.2 i need to relogin and retype all of my API keys gin which is not really a big deal, but i'll try no.1
Thanks for the info. I'll get back to you !
i think i'm very noob, since i cant find the template instructions to follow to

i tried using pgadmin instead, but i dont understand how to remove files hahaha, helpp

i think i'm wrong, pgadmin and filebrowser is a different kind of browser :/
help
8 months ago
PG Admin is a database client, you can't access files through that.
8 months ago
As you stated, you uploaded files so you need a filebrowser.
8 months ago
You see the disciplined-volume? did you add that? where that volume came from?
8 months ago
You need to disconnect the n8n volume (I think it's the 'Worker' volume, not 100% sure about it though), you can do so by right clicking the volume -> disconnect volume.
Then you need to attach the disconnected volume into the Filebrowser service, you can do so by clicking the Mount button, selecting the Filebrowser service and set the path to /data
8 months ago
Redeploy the Filebrowser service, access it and the files should be visible.
8 months ago
If your uploaded files aren't in the Worker service volume then try the same with the Primary service
8 months ago
If you are still having trouble I can record a video on how to do it by the end of the day (just arrived at my office)
8 months ago
Yep we had disabled that, had too many users that disconnected or deleted their volume and lost data.
8 months ago
Why does it need to be cleaned?
8 months ago
He uploaded some files to that volume through n8n
As i stated, Because i only have 3 workflows which all of them are idle. But somehow its taking almost 1 gigs
8 months ago
I would advise against trying anything here, you would be putting yourself at a high risk of data loss
8 months ago
My advise would be simply to leave it as is
The cost that i pay would pile up, to something i didnt use that much
8 months ago
The database's volume has ~600mb used?
I believe it will only add up, and no way of cleaning it. And it might be even bigger cost later on if i dont know how to clean the files
8 months ago
Where do you see that?
8 months ago
None of those graphs display 1GB?
8 months ago
Maybe so, but they still do not display 1GB as of right now
8 months ago
632MB
Since i only store 3 n8n workflows there, and alot of API keys which would be a huge hassle of i need to input everything again
And if i dont know how to clean that up, in the future the price might pile up and gets very expensive monthly
8 months ago
My advise stands, I think medim would agree here
8 months ago
Its at 632MB, we are not at the point to worry about cleaning it up
8 months ago
If you can't access and delete those uploaded files directly through your n8n dashboard it's better to leave it that way than messing with volumes and overcomplicating solutions
Okay so the solution is when it piles up too much, i need to wipe the volume and re-do everything from scratch
8 months ago
$5GB of data will cost 75 cents
8 months ago
You can do what I suggested but it's complex and can cause a data loss, If you gonna do that to every file you upload then it will become tiresome.
8 months ago
I took a look at n8n forums and seems like you can send delete commands as actions in n8n and delete those files
As i stated this is for future knowledge if the data has piled up so much. Since i need to know if i can use railway longterm or not
8 months ago
8 months ago
There are more costs than just disk
Oh yea, the highest cost is the memory
Seems i got mixed up from memory and volume while trouble shooting
Sorry to get distracted, since the title is already memory usage. Its my mistake i searched disk and drag you guys along
8 months ago
The software simply uses the memory it needs, it out of your hands unfortunately
8 months ago
Yes, it's the best you can do, just test it thoroughly to see that it doesn't interrupt any workflows.
8 months ago
!s
Status changed to Solved medim • 8 months ago


