![]() ![]() Default heap memory size of nodejs app and the GC Alternatively, you can use a third-party memory profiler like `heapdump`, `v8-profiler` or `v8` You can use the built-in memory profiler in NodeJS by running your application with the `-inspect` flag and then connecting to the profiler using the Chrome DevTools. This finding ruled out memory leaks and bugs. The total memory required by the Kubernetes cluster was: `4x2x2GBx3 = 48GB` Memory profilingĪs a first step, we ran memory profiling (./NestJS%20memory%20profiler%20documentation.md) for our apps and found that they were utilizing around `100MB` of memory. `3` environments (dev, release, production) So, we had to set the memory limit to `2GB`. We encountered a () error during startup when we set the memory limit of each pod to `1GB`. We have changed our start command to `CMD ` instead of `"start": "nest start"` since it is more suitable for production deployment. We have three different active environments(Dev, RC and Prod) where we are running these services. In this article, we explain the problem we faced, which led us to explore the optimization strategies we employed to improve memory usage and reduce costs, and we explain the steps we took to address the issue.įor our web3 app, we developed one web service(web api) and three worker services (background services) using NestJS framework. Our application was memory-intensive, which led to high costs and scalability issues. ![]() In this context, we discuss the challenges we faced while running our Node.js app developed in NestJS framework, on an Amazon Elastic Kubernetes Service (EKS) cluster with multiple nodes, behind a load balancer and Web Application Firewall (WAF). Modern web applications require reliable and scalable infrastructure to handle user traffic, and Amazon Web Services (AWS) offers a robust cloud platform for hosting applications. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |