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
asked 3 months ago165 views
1 Answer
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
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions