Next.js Discord

Discord Forum

Next js 12 App crash issue

Unanswered
Chow Chow posted this in #help-forum
Open in Discord
Chow ChowOP
Hello, I want to asked something related to Next js 12 deployment on AWS Elastic, recently since January my website starting to crash due to backend api node js 502 which is because of server capacity and theres no backend issue, this happens due to frontend + backend communication on SSR which is not working sometimes and stops node process, my home page handles 2 apis for business logic, it was running smoothly since last 5 year and since january this issue is occuring, home data of multiple api size is 51kb, home page job is to:

getServerSideProps
Fetch backend api -> SSR-> Generated HTML output

I cant use getStaticProps due to multi region content, for e.g. if some one from germany have open the website than other user from Netherland opens website, so both will have separate content region wise, backend handles automatically with ip which i sent, and I m sending IP correctly, the infra that devops have created is:

AWS Elastic -> Cloudflare -> Next.js

now they are currently doing

AWS Elastic -> Docker -> pm2 fork -> Next.js

but i have tried a lot with pm2 cluster on docker but unable to create

Have u guys ever faced this isse?

Is my Next.js hosted on AWS Elastic needed different and mandatory setups?

Or I should do something different?

ChatGPT is telling me to use p-limit and node-cache but this will increase the complexity of my app as backend already uses redis, it will be a helpful for me if someone provide me helpful information

0 Replies