EC2 Server Status Check Failed

0

Hello, I am using an EC2 free tier instance with Ubuntu, Mysql 8, Apache 2 and Php 7. From time to time, the instance status check fails and I need to reboot it manually. I eventually created an automatic reboot if the instance check stays failed for more than 1 minute

I also noted that when there is a heavy demand for the web app (eg in the morning when teachers access the school app) the server no longer responds to then resume ten minutes later.

I want to know where to look for the error. Is there a log in AWS that could shed some light or do I need to look at the OS level?

Any help would be most appreciated Thanks

Karvesh
asked 2 years ago489 views
3 Answers
0

Thanks for the answer. I am using a T3 micro instance with 1GB memory and 2 vCPUs.

I checked the CPU credit balance over a period of 3 months and the balance has always stayed around 288 and barely went lower than 260 in some occasions.

However, I check the Ubuntu log and came across this error message: Out of memory: Killed process (mysqld)

I got the impression MySql has been killed during the peak morning period.

Is there a way to see my memory usage as a dashboard in AWS console? Also, what is the best way to increase my memory in this case?

Thanks

Karvesh
answered 2 years ago
  • And just now, i tried to SSH to my server, it will not log into it. it says: ssh: connect to host ... port 22: Connection timed out

    And on the AWS console, it says 1/2 checks passed: Instance reachability check failed.

    Rebooting the instance solved it again.

    I am a bit at a loss here

0

You haven't mentioned what type of instance you're using. It sounds like you're using a T-series instance. These instance types run on a burstable CPU credit system; if the instance is busy then you will draw down on your credits until you reach a baseline level of performance which may be too low for your requirements.

Two solutions:

  • Use "unlimited mode" - your performance will not change when you run out of credits but we will charge for the time when you do.
  • Use a non-T series instance which doesn't use the burstable CPU system (all of the other instance types).

Note that you can monitor your CPU credits to see if this is what you're experiencing.

More information is here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-credits-baseline-concepts.html

profile pictureAWS
EXPERT
answered 2 years ago
0

If rebooting fixes your issue then it sounds like you are running out of Memory. You could try creating an image of your existing instance, stop that instance, and create a new instance from that image on a larger instance. If you are on a micro, I would go up several tiers (medium or large) just for testing and see if that makes a difference. If you are still getting MySQL memory errors at that point then I'd say you have an issue with MySQL. https://docs.aws.amazon.com/prescriptive-guidance/latest/backup-recovery/ec2-backup.html

If you want to log memory information then you need to install the CloudWatch agent. https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/metrics-collected-by-CloudWatch-agent.html

answered 2 years 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