need help with optimization of Memory Usage
detlixx
HOBBYOP

2 months 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

2 months ago

nestjs


And what memory usage are you seeing? (numbers)


detlixx
HOBBYOP

2 months ago

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

1457703377902502100


detlixx
HOBBYOP

2 months ago

This is peak requests in last 30 days

1457703938529951700


2 months ago

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


detlixx
HOBBYOP

2 months ago

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


2 months ago

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


detlixx
HOBBYOP

2 months 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

2 months ago

this sometimes strikes to 6 somehow


ghaithzamrik
PRO

2 months ago

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


2 months 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...