8 months ago
I have been grappling with higher than normal memory consumption on a Nuxt 3 application hosted on Railway. I reported it first in mid-september (I won't link because that support ticket is private) and I have spent countless hours over the last 4 weeks tinkering and trying many different things to find the "leak" or the cause for the memory consumption.
I have gone through every single file in my repo and practically rewritten over 65% of the logic to ensure every event, every timeout, etc is cleared. The application is much better for it actually, but unfortunately I still see my memory graph on Railway steadily going up and up... Sometimes it gets so bad i have to manually trigger a deploy in order to "reset" it back down.
I deployed the same app instance on Netlify as a test, and I have been absolutely hammering it with oha
- 10s of thousands of request and it maintains its memory - even if it spikes, it comes back to down to a constant ~197mb.
Now granted, Netlify is officially "supported" by Nuxt 3 and has its own Nitro preset (under the hood I don't know how that differs from the default preset which i use for Railway - node-server
). Here's the docs: https://nitro.unjs.io/deploy/providers/netlify
I am no way trying to compare the two platforms, i'm just honestly at my wits end here - no idea what else to do other than to ask here if someone has had any similar issues in the past or whether someone has any tips on deploying it differently to railway.
Thanks folks
3 Replies
8 months ago
I've attached some image showing the memory consumption on both platforms.
Attachments
8 months ago
---@mod - please delete this - don't want to waste anyone's time. I'm seeing increases in netlify, albeit much less aggressive, but i was wrong in my initial test. A memory leak is still very much caused by my code. Apologies.---
Nope - spoke too soon lol. After running another huge test and then waiting 10 minutes, it's actually back down to ~197mb! (This is on netlify)
8 months ago
Hello,
Generally there's not much we can do to help here, think of us as a power company, could your power company help you to reduce unknown power usage? not really, they don't know why or what you are using, they only know how much you are using.
So to clear any doubts, that graph is accurate, that is what your application is using.
I acknowledge the difference, but at the same time, from my understanding netlify is serverless, so it wouldn't be kept alive long enough for you to notice the same memory growth you do on Railway, we are not serverless and run your application 24/7.
The best advice I could offer you now would be to try running your application with different node versions, different node-adapter versions, alpine or debian, etc.
Status changed to Awaiting User Response railway[bot] • 8 months ago