Lightsail Instance Freezing

0

I have a Lightsail instance with 1GB RAM and 2 CPUs, it's running Ubuntu 22.04, Docker, and 3 containers for web development and testing (MySQL, Cloudflare Tunnel, and a small web app). It's been running for a few weeks now and it has crashed twice where the virtual machine is unresponsive. Trying to view the web console just shows a black screen. Rebooting the instance restores it to working for the moment. How do I determine the cause of this issue and prevent it from happening?

질문됨 2달 전91회 조회
3개 답변
1
수락된 답변

After further investigation I found that Ubuntu does not create any swap file by default and, therefore, it makes sense that the system would crash if memory usage hits max capacity. I have now created a swap file for my machine and will continue to monitor to see if this resolves the issue. I suspect it will.

답변함 2달 전
profile picture
전문가
검토됨 2달 전
  • It has now been a while since creating the swap file and I've confirmed that the system is no longer freezing. Creating a swap file fixed the issue and this makes sense, I was just unaware that Ubuntu did not have a swap file by default.

0

It might well be the case that there are some CPU spiker making the instance unstable. Monitor CloudWatch metrics like CPU utilization, memory usage, and network traffic to identify what is causing the spikes. The CloudWatch agent can help with this.

Check for any processes running on the instance that may have memory leaks or are consuming excessive resources over time.

Verify application configuration and resource usage to ensure it can handle the expected traffic levels.

Consider upgrading to a more powerful Lightsail instance tier if the workload demands higher resources.

As a last resort, migrate the application to EC2 where you have more control over resources and scaling options if needed to handle spikes.

profile picture
전문가
답변함 2달 전
  • Thanks for the reply. I'm inexperienced with Linux. Can you tell me how to view logs about when the crash may have occurred and perhaps more details? I also suspect it's RAM or CPU usage hitting a limit but would that cause the whole OS to crash normally?

0

Hi, there, There are several instance metrics available such as CPU utilization and Burst capacity, you can find out details about these metrics from this doc: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-viewing-instance-health-metrics.html

Also, Lightsail instances provide a baseline amount of CPU performance and have the ability to temporary burst the performance. If you used up all your CPU burst capacity, your instance will no longer be able to burst the performance. Check this doc for more details about Lightsail instance burst capacity: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-viewing-instance-burst-capacity.html

Thank you

AWS
yujie
답변함 2달 전
  • Thank you for that information. I understand how the cpu utilization may reach some capacity and slow things down perhaps. Or perhaps RAM capacity could reach a limit. But should those limits cause the server to crash or just slow down until they can catch up?

    I suspect it’s most likely RAM usage. Is there a swap file or virtual memory by default that would help out if going over available memory? How would I check that configuration?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠