R
Railwayβ€’3mo ago
Rafa

Excessive memory usage and $$ to keep Next.js project running

I have a Next.js Project with currently 0 active users costing $20 a month just to keep it live. Any suggestions on how to debug and reduce this memory usage? Thanks!
No description
Solution:
got rid of next/image + updated next.js to the latest stable (14.2)
Jump to solution
19 Replies
Percy
Percyβ€’3mo ago
Project ID: 14a3af77-b63d-4ec2-97c9-16784e1486e3
Rafa
RafaOPβ€’3mo ago
14a3af77-b63d-4ec2-97c9-16784e1486e3
Brody
Brodyβ€’3mo ago
are you perhaps running it in development mode?
Rafa
RafaOPβ€’3mo ago
Hey @Brody , thanks for the quick reply not aware of this setting, how can I check?
Brody
Brodyβ€’3mo ago
not a railway setting, you have to know what mode you are running your next site in
Rafa
RafaOPβ€’3mo ago
i mean, i don't have any different build/start command, so I'm using the default
Brody
Brodyβ€’3mo ago
are you following next's best practices when running in a production environment
Rafa
RafaOPβ€’3mo ago
yeah, and i'm running on production mode... i've got rid of next/image + updated next.js to the latest stable (14.2) and will push live to see if I see any improvements (also added the flag --experimental-debug-memory-usage)
Brody
Brodyβ€’3mo ago
then I'm not too sure what else I can help with, it seems like you covered everything I would have said already. the only thing left I can say is that you should ask the next community for support, as railway doesn't have any more observability in what your code is doing than you would, we are simply running your app and reporting on the metrics it uses.
Rafa
RafaOPβ€’3mo ago
makes sense @Brody - thank you πŸ™
Brody
Brodyβ€’3mo ago
sorry we couldn't be of more help but unfortunately we aren't able to offer application level support here beyond some basic pointers.
Rafa
RafaOPβ€’3mo ago
you're always very helpful, super grateful for all the support - this is not the first time you help me out :salute_guy:
Rafa
RafaOPβ€’3mo ago
btw, seeing some early good signs 🀞
No description
Brody
Brodyβ€’3mo ago
what did you do?
Solution
Rafa
Rafaβ€’3mo ago
got rid of next/image + updated next.js to the latest stable (14.2)
Rafa
RafaOPβ€’3mo ago
i think should be mostly a memory problem from the version i was using
Brody
Brodyβ€’3mo ago
interesting
Rafa
RafaOPβ€’3mo ago
next/image is barely used on my app, but i've seen some reports of problems with it so i did both changes i was on next 13.1.1
Brody
Brodyβ€’3mo ago
well I'm glad it made such a drastic difference
Want results from more Discord servers?
Add your server