R
Railway

✋|help

Big memory usage

Ffedev1008/29/2023
I have a nodejs app running some tasks and it seems like the ram is increadibly high in the railway charts. I tested it locally and I did not get this behaviour. I also added logs about heap usage every 2 seconds (using process.heapUsed) and they stayed constantly between 0.7 and 1.1 GB, while railway charts rapidly growed up to 4GB of usage (reaching also 22GB in another deployment) before I stopped it.
Ffedev1008/29/2023
4900bb8f-ad4a-4e22-bbe9-115063046480
Ffaolain8/29/2023
I'm not part of the railway team but I had a similar issue on a Python app that the railway team helped diagnose. Do you happen to be reading the max about of CPUs anywhere in your code to spawn workers? In my case that was happening and even on the hobby plan it made an app that normally takes 300mb take up 3gb of ram. Realized I needed to be explicit for the workers spawning. The deploy logs could possibly help to narrow down what could be causing it.
Ffedev1008/29/2023
ok thanks, how do I do that
Bbrody1928/29/2023
who from the railway team helped you diagnose that because neither me or coffee work for railway lol
fedev, with the wonderful information faolain has provided please try to do research around the topic yourself too
Ffaolain8/29/2023
I assumed you worked at railway?
Bbrody1928/29/2023
nope
Ffaolain8/29/2023
You can tap the deploy logs tab on the UI when you click into the service that's using all the memory
Bbrody1928/30/2023
Ffaolain8/31/2023
So same thing hehe, maybe it would be good @Brody if this was on the Railway documentation somewhere? since it seems like a lot of people come across
Bbrody1928/31/2023
yes it would be good, where would it go though
Ffaolain8/31/2023
maybe under Troubleshoot in a new section or under Fixing Common Errors
https://docs.railway.app/troubleshoot/fixing-common-errors maybe a section of big memory usage, showing the steps from above to triage what could be causing it (checking deploy logs, if your code reads the max default workers)
Bbrody1928/31/2023
well ideally, it just wouldnt be a problem lol
Ffaolain8/31/2023
agreed I think you mentioned you escalated to the railway dev team right?
Bbrody1928/31/2023
yep they know
it looks like this can be solved with passing --cpuset-cpus="0-7" to the docker run command, of course this isnt something a user can do

Looking for more? Join the community!

Recommended Posts
Cannot terminate old instanceI have an old instance running alongside the latest one, and I cannot find a way to terminate it thrGitHub deployment triggers became inactiveDeployment trigger to main branch became inactive, I am on a paid plan.no build errors but serve command keeps crashingHi, I’m new to nx workspace, nest and railways.app. I did some changes and I pushed them to my GitHTemplate variable function ${{ secret() }} broken for new template deploysHey, I have a plausible analytics template on railway. I just got an issue on my GitHub repo for theRepo changes not being deployed automaticallyHi, I've made some fixes on my GitHub repository and the changes are not being deployed automaticallConnecting to custom postgres instanceHello! I have just set up a postgres service with custom dockerfile because I'm starting a new proje2 days in a row 7am server stops respondingI have a weird issue with my deployment. Nothing like that happened before. For the last 2 days aroui need help setting up my discord boti need someone to help me configure the database [ i am extremely new to this ]Time between new deploymentsSince I can't find this question, how many seconds does a deployment get removed after a new one goeHobby plan paymentHey do railway accept debit cards ? If yes then why isn't it working?Nobody answering emails on billingHow come nobody is answering the emails i send to billing@railway.app?Access Railway server via http, not https?Hello guys, any one can let me know to access my railway server using http link? ex: http://myservePR environments are not being deployed for the project ownerFollowup to https://discord.com/channels/713503345364697088/1006629907067064482/threads/114578691488Railway PaymentI don't have credit card and unable to get one in our country. Can i make payment using debit card ?Django project: install phase times outWe're currently evaluating Railway because we want to move away from AWS and have a more pleasant anNew to railwaysTrying to move my stuff from a VPS to railwayCancel subscription and then switch to credit, but between...?Hello, I have a doubt about the procedure to switch hobby plan from usage to credit based. Maybe theQuestion: When pushing updates to GitHub repo, will those changes be updated in my custom domain?I pushed a fix into my GitHub repo, which my site is being deployed from, merged to the main branch Template Submission Next StepsHey, I made this post over in #⚡|templates but I think it got deleted for some reason? so going to Nextjs build fail - runc run failed: unable to start container processDeployment ID dd25dd4a-51bd-489e-94a0-387b5ef51852 and [github repo](https://github.com/ballermatic/