Memory usage for deployed Node apps

a year ago

Hi! I have deployed two Node apps (a Next.js frontend and a Nest backend) about two weeks ago. Each app has about 300-400 MB of constant memory usage, which I believe is expected in Node apps. However, in the pricing about 90% of my current usage comes from memory usage, whereas CPU, disk and network usage contribute very little to the total.

For some reason, I imagined each component would contribute a similar amount to the total - having a large 'gap' like this may be a sign that there's something wrong, especially since my projects aren't large. But memory may well be the largest contributing factor in most projects(?) - I'm not sure since this is my first project deployed with Railway.

Also, there don't seem to be any memory leaks happening - the line just remains flat all the time, with small fluctuations.

So, I'd just like to ask, is this price 'discrepancy' is expected for Node apps - has anyone else dealt with this in their projects - or am I doing something terribly wrong? Thanks!

0 Replies

a year ago

333f0a15-0fd0-46be-8d54-a043c9893a2e


a year ago

from my experience the vast majority of apps are going to have a high memory to cpu ratio, and 300 to 400 is right around what other people average for next and nest apps, so I can assure you there's nothing wrong here!


a year ago

alright, glad to hear that! 😄


a year ago

I was playing around with the settings and found out you can set a memory usage limit per service, however it only goes as low as 1GB so I think it would not help much there

1266889581421265200


a year ago

it would also crash loop your app if you could set it to say 200MB


a year ago

yeah, not a very good idea probably haha


a year ago

There's also app sleeping, would this be a viable option if my web service doesn't receive too much traffic?

1266889972074418200


a year ago

yes but please keep in mind there are many things that can't go to sleep for many reasons


a year ago

yep, alright!


a year ago

let me know if you have any more questions about anything!


a year ago

sure!


a year ago

thanks a lot 😄


a year ago

no problem!


Memory usage for deployed Node apps - Railway Help Station