- 최신
- 최다 투표
- 가장 많은 댓글
Sounds like this may be an Ubuntu issue.
I have a couple of suggestions to help troubleshoot further.
https://serverfault.com/questions/1030527/exiting-ssh-sessions-suddenly-killing-apache.
I generally don't like to use ssh to connect to my instances. Using Systems Manager Session Manager on the host may help you get into the system, while it is up and not responding to ssh, to look around and find more info.
https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html
Question . . . Have you patched recently?
Could it be resource exhaustion? Take a look in the Monitoring tab of AWS Console, and look for anything that's unusually high, or otherwise out-of-line.
Also consider setting up CloudWatch agent to collect more detailed system logs https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html
What instance type is being used here?
After doing some more research into this problem, I found out that the EBS read/write on this instance are way higher than they should be. The web site should be visited by no more than a few people a week (family and friends), but appears to be hammered by crawlers, robots, spammers and hackers. If this goes on Lightsail will probably be a better solution. Too bad as I also use this instance to keep my AWS skills to par.
For now I will try to do some mitigation with anti-spam and bot blockers. No sense in upgrading to a t4g.small for something that should be this small and low in traffic.
Anything is possible, but I don't see anything that pops out on the monitoring tab. It was hung again this morning, so far not been possible to connect a terminal session. If that were possible, I could do some better troubleshooting...
I guess I can delve more into the CLoudWatch agent. That will take me a while to research and setup. I've been quite intimidated by the AWS setup of tools. :-)
The instance is a t2.small
:-) I patch regularly, usually weekly.
This morning when it didn't respond, I tried to use session manager to connect instead, but unfortunately that did not work either. I found a console option too, but also would not connect. Can't find that console option anymore, I should have bookmarked it.
I will take a look at the link you posted.
Edit: It looks like the ssh problem mentioned in the link was not applicable. That occured on Ubuntu 16.04. I am running 20.04 LTS and also the apache session is started as root under which this should not occur
If the issue is resource exhaustion You should be able to see some indicators in ClodWatch metrics. You could also look at the AWS Compute Optimizer to see if it is recommending a larger instance.
If you need more resources, you could snapshot the instance, Create an AMI from the snapshot and launch it on a larger instance size.