EC2 instance out of memory, trying to find root cause of memory error

0

We have a Node application running on an EC2 instance that spins up a process for each CPU core on the instance. Lately the instance keeps running out of memory and killing the process. The redundant system work perfectly fine, meaning that it spins up another instance and the load balancer directs traffic towards it when the instance becomes unresponsive.

The problem is that we are now trying to discover what cause the instance to run out of memory in the first place, so that we may optimize our code and prevent it from happening in the first place. Unfortunately we cannot check the logs for this because of log suppression. We have tried turning this off, but to no avail, we still end up with a gap in our logs from when the instance was unresponsive.

Any ideas how we might find out what in our application is causing the instance to run out of memory?

질문됨 9달 전482회 조회
1개 답변
0

I'd suggest you to consider installing cloudwatch agent, which would continuously keep sending the logs to cloudwatch.

Here are the references to AWS Documentation for same:

profile pictureAWS
전문가
답변함 9달 전
profile pictureAWS
전문가
검토됨 9달 전
  • We already have cloudwatch running on the instance. That is how mostly how we search our logs. However since the logs are not being produced in the first place, they are unable to be sent to cloudwatch

  • Is it happening continuously for newly launched instances too or that happened for one instance?

  • It happens sporadically on random instances. It is almost certainly a mistake in our programming, but without the logs it is almost impossible to find out at what point something goes wrong.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠