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条)