Excessive memory usage using npx nest start service
See original GitHub issueFirstly, wow this project looks super interesting!
I ran into a snag spinning up each service as suggested in the docs:
NODE_ENV=staging npx nest start service-auth
Each service consumed about 2GB of memory on my poor little machine. With more than half a dozen services to spin up and my machine only having 8GB memory… 😱
It appears to be related to this issue https://github.com/nestjs/nest/issues/2135 where it’s established that ts-node is the culprit. tsc-watch is suggested as a solution there. Perhaps that would be a good idea?
I got around the issue by building each service and running them with node from the dist directory however that felt awkward. Digging deeper I realised you’re using docker (have used a little), terraform, and kubernetes (have not used either of them). I noticed development configs there alongside staging and production… so perhaps I’ve misunderstood and there’s a simpler way to manage devops in development?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
@av8ta sure thing, I will look into fixing it the ts-node issue. Thank you 😃
Thanks for the speedy reply. I agree totally with “I believe it’s high time NodeJS gets clearly designed boilerplates or template for building enterprise systems.” and I’m seriously considering using this in production. For now I’m just trying to work out how all the pieces fit together and perhaps as I gain understanding I can help with the documentation. I tried
TS_NODE_TRANSPILE_ONLY=true npx nest start service-user --watch
but it used only slightly less memory! I’ll have a play with it tomorrow (it’s midnight here) thanks for your time 😃