When your website’s infrastructure is in AWS, it can be tough to keep track of your resources. An often-underutilized solution is AWS CloudWatch, a service that does just what it sounds like - watches everything in your cloud and sends email alerts when something isn’t right. Here are six essential CloudWatch metrics that provide critical insight into how to optimize your AWS environment and ensure your site is meeting your needs.
1. EC2 Instance Status
Elastic Cloud Compute, or EC2, instances are the backbone of most AWS infrastructures. This metric pings your services at a time frame you specify (1 minute, 5 minutes, etc.) and alerts you when your instance is down. This alert is a must – you’ll be able to respond immediately if a server becomes compromised.
2. EC2 CPU Utilization
The EC2 CPU Utilization provides insight into how your website is being used. It measures:
- Usage: Is it constant or are there spikes?
- Server Utilization: Is it under-utilized or constantly at the breaking point?
This information helps determine when adding or removing a server can optimize the performance of a heavy workload. You’ll know precisely when to configure your server to reduce capacity to save money and when to increase capacity to support more users.
3. RDS Read and Write IOPS
Input/Output Per Second (IOPS) serves a similar function for Relational Database Service (RDS) instances as the CPU Utilization does for EC2 instances. You get real-time alerts in the event certain operations require more processing power than you projected. This data helps ensure your RDS instance is configured for optimal management of your website’s workload. For example, if you have a large report that was just released, you’ll know if there’s an unexpectedly high load on the server so that you can upgrade the capacity accordingly.
4. S3 Storage Size
Amazon’s Simple Storage Service, or S3, is an easy way to store documents your application might need, including images, videos, and music files. It’s also a convenient place to store user-uploaded content like profile pictures or documents. Several metrics can alert you if your S3 bucket is being used (or over-used), but monitoring storage size is the easiest way to tell if your application needs upload restraints or if your site is growing at a faster rate than you expected. An alert is triggered if your S3 bucket increases significantly in a short amount of time, enabling the IT team to quickly investigate and make the necessary adjustments.
5. Billing by Service or Overall
A common question many site owners have about AWS is, how much is it costing me? With billing metrics, you can set up alerts to notify you before costs get out of hand. If you have a dynamic environment, such as using autoscaling in EC2 to add more servers to meet higher demand, it’s possible to lose track of how much a service is costing you. Billing alerts let you know when you’re going out of scope, so you can re-evaluate your AWS configuration and avoid surprises at the end of the month. For smaller sites, it can also be used to notify you when you’ve gone beyond the free tier of AWS.
6. Custom Alerts Using Lambda
If you can’t find a metric that suits your needs, you can customize your own using AWS Lambda. With Lambda, it’s easy to create a function that can be called to check the status of operations. For example, suppose your website depends on a third-party endpoint for many of its functions, and you’ve had problems with this endpoint being unavailable in the past. A simple Lambda function can call that endpoint once a minute and alert you if it fails, warning you that a service is unavailable before users start submitting error reports. Learn more about how to create a Lambda function in A .Net Lambda Function That Creates Better User Experience at Sign-On.
Setting up CloudWatch alerts is an easy way to keep track of your AWS environment, and it can save a lot of time and money in the process. Alerts are highly customizable and provide business-critical information to the right person at the right time. With the proper configuration, you’ll never be in the dark about AWS issues again.