By using AWS re:Post, you agree to the Terms of Use

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.

asked 6 months ago21 views
1 Answer
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)

answered 6 months ago
  • 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.

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