Memory usage for deployed Node apps
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!
Solution:Jump to solution
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!
13 Replies
Project ID:
333f0a15-0fd0-46be-8d54-a043c9893a2e
333f0a15-0fd0-46be-8d54-a043c9893a2e
Solution
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!
alright, glad to hear that! π
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
it would also crash loop your app if you could set it to say 200MB
yeah, not a very good idea probably haha
There's also app sleeping, would this be a viable option if my web service doesn't receive too much traffic?
yes but please keep in mind there are many things that can't go to sleep for many reasons
yep, alright!
let me know if you have any more questions about anything!
sure!
thanks a lot π
no problem!