Next.js 项目消耗大量服务器内存。

huangapple go评论53阅读模式
英文:

nextjs project consuming lot of server memory

问题

我们有一个Next.js项目。这是一个构建器项目,网页从JSON数据加载,用户从构建器和仪表板中进行操作。用户不是很多。仪表板中始终有2-15个用户不断工作,还有一些额外的用户。但我们发现PM2进程的内存占用达到了2GB、3GB。我们使用的是32GB内存和16个CPU核心,并且在集群模式下使用所有资源。如何知道为什么以及哪个函数或页面占用了所有内存,并将其保持在较低水平?

谢谢。

英文:

we have a nextjs project. It's a builder project and web pages loads from json data and user works from builder and dasshboard. not much users. There are always 2-15 users working in dashboard continuously and some extra users. But we see the pm2 process is getting filled with 2gb, 3gb of ram. We are using 32gb ram and 16 cpu. We are using all of them in cluster mood. How to know why and which function or page taking all the memory and to keep it low?

Thank you

答案1

得分: 1

有自 NextJS 版本 13.3.5 开始报告的一个 bug,该 bug 也影响了 NextJS 的 "stable" 13.4 App Router 版本。它导致内存使用非常高。目前最佳解决方案是降级到 13.3.4 版本。
详见 https://github.com/vercel/next.js/issues/49929

英文:

There is a reported bug in NextJS since version 13.3.5, which also affects the "stable" 13.4 App Router release of NextJS. It makes the memory use very high. Currently the best solution is to downgrade to 13.3.4.
See https://github.com/vercel/next.js/issues/49929

huangapple
  • 本文由 发表于 2023年6月8日 03:38:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76426610.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定