process has been automatically restarted by PM2

0

I sometimes (lately once a week) receive notifications from PM2 Plus that some of my applications have been restarted, type: automatic.

PM2 is running inside an ECS instance. The memory utilization is close to 99% (all the time). The CPU has spikes, sometimes going up to 133% utilization.

How can I find the cause of the application restarts by PM2? PM2 detail logs? What are your guidelines regarding PM2 configuration? How about load balancing at ECS level vs at PM2 level?

Thank you!

Adrian
質問済み 4ヶ月前179ビュー
1回答
0

Hi,

Try setting up CloudWatch agent as a container in your ECS task which pushes all the logs(include PM2 logs) to CloudWatch and allows you to debug things. Follow this blog to setup CloudWatch agent in ECS task https://aws.amazon.com/blogs/devops/send-ecs-container-logs-to-cloudwatch-logs-for-centralized-monitoring/

PM2 restart reasons are a few:

  • Application crash
  • Empty event loop

As your memory utilization is close to 99%, try finding any data leak is happening inside the application.

Let me know if you have any questions

profile picture
回答済み 4ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ