My EC2 instance (t2.small) stopped accepting connections on SSH or its other service, but the EC2 control panel said the automatic status checks had not failed, even after several hours. I could not reboot it using the control panel, but I could stop it and start it again. It became unresponsive twice more that day.
After that, I configured cgroups to limit the CPU and memory usage of a mildly resource-hogging process, but that doesn't seem like the right answer. That shouldn't have brought the machine to a halt. (It has no swap, but the OOM killer should have simply killed a process if the instance was out of memory.) "Get System Log" and "Get Instance Screenshot" showed nothing suspicious. The server is running some fairly trusted software, like postfix and gitolite, plus an in-development server which was running as a user. When I look at the CPU usage graph, it shows 2.5% during that time, with occasional spikes to around 6%.
What can I do to figure this out and prevent it from happening again? All I can think is that it was a hardware issue, but I thought that would have been very unlikely.