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
preguntada hace 4 meses176 visualizaciones
1 Respuesta
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
respondido hace 4 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas