Frequently Linux instance is not running, have to reboot the instance to make it run again.

0

We using a t2.medium Linux instance to run Java and node.js server, which is often getting stopped. After a instance reboot we are able to make the server back to live.

Where can we look for the crash log regarding the same? and what could be the possible reasons for this behavior ?

Thank you.

Suvel
已提问 2 年前256 查看次数
1 回答
2

If you are running Java application on your server then please check memory usage of your application. This is the most common issue that app is using all the available memory and there is nothing left for Linux to run and it will stop responding.

For monitoring I suggest to install Unified CloudWatch Agent on your EC2 instance and enable metrics for memory and swap usage. (Don't forget to give additional permissions to your IAM Role /Profile attached to your instance) and if you do not have Internet Gateway then you will also need to have "monitoring" VPC endpoint attached to your VPC.

If this issue is related to memory over usage then you have 2 options - increase instance size (cost) , limit memory usage in your java / node.js configuration (no cost), add swap (file or additional disk) on your Linux instance (small cost)

已回答 2 年前
  • Thanks Maciej Malek it was very informative, I will definitely try it and will let you know.

  • We checked the RAM usage, from which we were able to find the memory was insufficient compared to the load that it took.

    For now, we have just added Swap space to the instance to handle the load, if it doesn't work well (still crashing or latency in communicating with the server ) we planned to upgrade the instance.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则