Amazon Lightsail Monitoring and Notifications

Amazon Lightsail gives virtual private servers (VPS) full cloud flexibility. You can set up all the instances, databases, and load balancers you need and add more as your requirements grow. You can set one up as a Linux server and use it however you like. Alternatively, you can get a preconfigured instance to fit into a developer stack, such as a LAMP or Node.js environment. Preconfigured application instances are also available. You can keep full control from the OS level up or start from a configuration that saves you most of the work.

An Amazon Lightsail instance can have DNS management and a static IP address. If you like, you can use a domain which you already have.

You can integrate Lightsail instances with AWS. S3 storage, Elastic Beanstalk, Identity and Access Management (IAM), Lambda, and many more services are available through Lightsail instances. Additional charges may apply.

Each instance comes with a specified processor level, amount of SSD storage, and data transfer allowance. The cost is based on a fixed monthly rate plus usage.

Lightsail monitoring

As with any kind of server, issues can arise. Instances might go down due to software problems. Their workloads might exceed their capacity. Malware infections are possible. You want to make sure your systems are running smoothly, but you don’t want system administrators to spend all their time doing manual checks.

To help you to track system status, Amazon Lightsail includes monitoring, notifications, and alarms at no extra cost. Setting up notifications lets you find out quickly if your VPS instances aren’t performing properly. Administrators get notified through the dashboard or by SMS and email notifications.

You can set up monitoring on a variety of metrics. For any metric, you can define as many as two alarms. An alarm specifies a threshold value and a time period. If the metric exceeds the threshold to a specified extent within a period, it triggers a notification. The point of having two alarms is that you can set up a warning when the metric goes outside the safe range and a call for action when it reaches a critical range.

Lightsail monitoring retains statistics for at least 15 days. You can review the statistics to identify trends in usage and make long-term plans.

Lightsail metrics

Instances, load balancers, and databases each have a set of resource metrics. A metric is a set of data points ordered by time. It quantifies a value representing resource utilization or availability, performance, or error conditions. The units depend on the kind of metric.

Lightsail defines the following instance metrics:

  • Incoming and outgoing network traffic
  • CPU utilization
  • Status check failures (instance, system, or both)

Available database metrics are the following:

  • CPU utilization
  • Database connections
  • Network receive and transmit throughput
  • Disk queue depth
  • Free storage space

The following metrics are available for load balancers:

  • Count of client TLS negotiation errors
  • Healthy host count
  • Unhealthy host count
  • Load balancer HTTP 4XX and 5XX responses
  • Instance HTTP 2XX, 3XX, 4XX, and 5XX responses
  • Request count
  • Instance response time
  • Rejected connection count

Each metric has a period or granularity. That’s the time interval between data points. Most metrics have a 1-minute or 5-minute period; the value is sampled once every minute or 5 minutes. Regardless of the period, Amazon Lightsail alarms evaluate the metrics every 5 minutes.

FREE PERFORMANCE CHECKLIST Your site performance checklist to help you assess your website health   

Metric values are retained for at least 15 days; they may be retained for a longer term at reduced resolution. If you need to keep their values permanently, you can export them to another storage facility. Statistics including the average, sum, and maximum are available over the retention period.

Setting up alarms

A metric triggers an alarm when it exceeds a threshold for a specified duration. You set the threshold and duration when creating the alarm. This way, brief spikes don’t set the alarm off unless you want them to. “Exceeding” a threshold can mean falling below a certain number, in cases such as healthy host count or free storage.

The first step in the setup is to create email contacts in your Lightsail account settings. You can have one contact for each AWS region you run Lightsail in. If you want email to go to multiple contacts, you need to set up a mailing list and give Lightsail the list address.

Next, scroll down to “Add SMS number” and give the phone number that will receive messages. Some AWS regions don’t support SMS messaging under Lightsail.

After that, you need to create an alarm. Find the instance, load balancer, or database on your Lightsail homepage. You will be taken to the page for managing that item. Select an item from the Metric dropdown menu, then click “Add alarm” on the metric’s page. In the dialog, set a threshold, a duration, and the number of times the metric has to exceed the threshold within the duration.

By default, the checkboxes for SMS and email notifications are checked. If the alarm is just a warning, you may want to uncheck them and get just a console alert.

You can test that alarms are working by setting a threshold so low it will always be triggered. An alternative is to manipulate a system to trigger the alarm, e.g., by taking it offline.

How to use alarms and notifications

There are a number of situations where alarms are useful:

  • To know when servers are being overloaded.
  • To catch instances that are down or otherwise not responding.
  • To detect signs of malware.
  • To identify configuration problems.
  • To decide when it’s time to add or upgrade your Lightsail instances.

Notifications always have to be used in moderation, or administrators will stop paying attention to them. But properly used, they will help to identify problems before they significantly affect the users. It could take some experimentation over time to find the best thresholds.

Lightsail is a simpler alternative to using the full array of AWS capabilities, and it provides a pathway toward the more complex and flexible full use of AWS. To find out if Lightsail is the best choice for your business and how to make good use of it, just contact us.

Newsletter Signup

Share