performance - Best practice for Nextjs projects on the production server - Stack Overflow

I've redesigned my website using the Next.js framework. I've tried to use a CND for statics f

I've redesigned my website using the Next.js framework. I've tried to use a CND for statics files (images, CSS, JS files) and make it optimized.

Also, I've worked a lot on the APIs to respond fast. It should be noted that the number of concurrent users on my website is high. On the pick times, about 30k concurrent users.

I've upgraded the server resources, 64GB RAM, 16 core CPU, and SSD storage. (Ubuntu 20.04 OS, PHP - Laravel for the backend and MySQL for the Database)

But still the website is too slow when over 2k concurrent users are on the website.

I've even modified Nginx and FPM configs (connections, children's) to make the server perform better, but no success with a huge traffic load.

I had to code the first page of the website using plain HTML and vanilla JS to check whether the issue was with Next.js or the backend. I realized that the problem was with Next.js because the project worked very fast and without any lag when using raw code.


Also, Based on some research, some major websites use the Next.js framework and simply handle a heavy load as well. How do they do that?

It should be noted when I run htop on the server, I see there are lots of processes running by Next.js server. Not sure what they are.

I don't use SSR and I run the project using PM2. It servers the project on port 3000 and nginx handles the request to it using a reverse proxy.

Is that the correct approach for Next.js projects on the production server?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744598336a4583024.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信