I am running NextJS server on AWS EC2 instances. I use pm2 to manage my applications. The setup works pretty fine but the problem is after a few days the server stops responding with a 522 status code.
Once I restart the apache server with /opt/bitnami/ctlscript.sh restart apache
it starts responding again.
I has been happening a long time and I have no clue what makes it happen. Last it happened there was around 730MB of free memory available out of 966MB. And processors were almost idle.
Here is the htop
output image.
image of htop output
here is output from cat /opt/bitnami/apache/logs/error_log
I have replaced the domain name with example.com and IP address with ***
https://pastebin.mozilla.org/YatsOA3i
Thanks for your time and help.