need help with optimization of Memory Usage
detlixx
HOBBYOP

a month ago

Hello, recently i found out that my project is taking a lot of memory even when that app has almost zeru users 😄 and i already checked code for some memory leaks, but there were none, so its either something with railway or there is something else.. Thanks for help

12 Replies

This problem is not on Railway's end. Base memory usage differ per project. What project are you running? What runtime?


detlixx
HOBBYOP

a month ago

nestjs


And what memory usage are you seeing? (numbers)


detlixx
HOBBYOP

a month ago

Big for dead server that has Enabled Serverless and 1 CPU / 1 GB RAM

1457703377902502100


detlixx
HOBBYOP

a month ago

This is peak requests in last 30 days

1457703938529951700


passos
MODERATOR

a month ago

500MB looks pretty normal to me. Are you sure it's a memory leak?


detlixx
HOBBYOP

a month ago

No i told that i checked for memory leaks and thre were nothing that could do it..


passos
MODERATOR

a month ago

I'm saying that 500mb looks normal (nestjs consumes by default 500mb-600mb), are you sure it's increasing overtime?


detlixx
HOBBYOP

a month ago

yeah i have some other projects also in nestjs, they have almost same small usage and they are 1-2e max per month


detlixx
HOBBYOP

a month ago

this sometimes strikes to 6 somehow


ghaithzamrik
PRO

a month ago

Not sure about Nestjs itself, but maybe check if you have any blobs that are in memory due to user requests?


passos
MODERATOR

a month ago

What do you mean by 1-2e? Also, from your screenshots, your NestJS project doesn't exceed 500MB in 30 days, which is completely normal for a NestJS project. Regarding the Serverless part, Railway will repeat the last registered value on charts, but your application is actually sleeping if that's what's causing you trouble (basically, you're not billed when app is sleeping but it'll register it on the charts).


Loading...