How do I troubleshoot common issues that cause my Lightsail instance to be unresponsive?

4 minute read
0

My Amazon Lightsail instance is unresponsive. I want to know the reasons why and how to troubleshoot these issues.

Short description

If your instance is unresponsive, then review the instance metrics to determine how to troubleshoot. Lightsail uses two status check metrics to monitor instance health:

System status check: Detects issues with the underlying host that your instance runs on. If the underlying host is unresponsive or unreachable because of network, hardware, or software issues, then this status check fails.

Instance status check: Indicates operating system-level issues or resource over utilization.

Resolution

System status check failure

If the system status check failed, then stop and start the instance to migrate the instance to a new, healthy host.

Note: A stop and start isn't equivalent to a reboot. A start is required to migrate the instance to healthy hardware.

Warning: The instance's public IP address changes every time you stop and start the instance. If you don't want the public IP address to change on every stop and start, then attach a static IP address before you stop the instance.

Instance status check failure

If the instance status check failed, it might be due to operating system-level issues that cause boot errors or over-utilization of the instance's resources. The following are common reasons:

OS-level issues

OS-level issues that can cause an unresponsive instance include failure to boot, kernel panic, network failure, incorrectly mounted volumes, and incompatible drivers. Also, there might be block device errors, software bugs, stuck tasks, or file system issues. To resolve these issues, reboot or stop and start the instance. If a reboot or stop and start doesn't resolve the issue, then you might need to migrate the Lightsail server to Amazon EC2 for further troubleshooting.

High CPU usage

High CPU usage, an exhausted instance memory, and full disks are common reasons for resource over utilization.

View the instance's CPUUtilization metric. Note whether the CPU utilization is above the sustainable zone. This means that your instance is reaching burst capacity and is under heavy load.

If the instance is reaching burst capacity, then use the following methods to troubleshoot:

  • Reboot your instance to return it to a healthy status.
    Note: If your instance CPU requirements are higher than what your current Lightsail plan offers, then the issue will occur again after a reboot.
  • Change to a Lightsail plan that meets your CPU requirements.

Exhausted memory

When the memory is exhausted, the kernel doesn't have enough memory to run. When this occurs, other processes are stopped to free memory, and the instance becomes unresponsive. To reduce memory usage, either reboot or stop and start the instance.

Disk full errors

If the root device is full and the file system reached capacity, then the instance might enter into emergency mode. To resolve this issue, increase your Lightsail plan or bundle your plan with one that has a larger volume size.

To upgrade your Lightsail plan to a larger instance, complete the following steps:

  1. Create a snapshot of your instance.

  2. Create a larger instance from the snapshot.

  3. Connect to your instance.

  4. Run the lsblk command to check the disk layout. Even though the disk space increases, there might be lack of free space. When there's a lack of free space, the automatic process that increases the partition and file system doesn't run. If this occurs, then free some space, manually increase the partition, and then increase the file system.

    To expand the size of the root partition or partition 1, run the growpart command:

    $ sudo growpart /dev/xvda 1

    To verify that partition 1 expanded, run the lsblk command:

    $ lsblk

    Run the following command to expand the file system and verify that your root partition is "/":

    $ lsblk -f

    Run the following command to expand an EXT2/EXT3/EXT4 file system on partition 1:

    $ sudo resize2fs /dev/xvda1

    Run the following command to expand an XFS-type file system. In this command, "/" is the volume mount point.

    $ sudo xfs_growfs -d /

    After you expand the file system, run the df -h command to verify that the OS recognizes the additional space:

    $ df -h

Related information

Create Amazon EC2 instances from exported Lightsail snapshots

AWS OFFICIAL
AWS OFFICIALUpdated 2 months ago