Monitoring Storage Gateway - AWS Storage Gateway

Monitoring Storage Gateway

In this section, you can find information about how to monitor a gateway, including monitoring resources associated with the gateway, using Amazon CloudWatch. You can monitor the gateway's upload buffer and cache storage. You use the AWS Storage Gateway console to view metrics and alarms for your gateway. For example, you can view the number of bytes used in read and write operations, the time spent in read and write operations, and the time taken to retrieve data from the AWS Cloud. With metrics, you can track the health of your gateway and set up alarms to notify you when one or more metrics fall outside a defined threshold.

Storage Gateway provides CloudWatch metrics at no additional charge. Storage Gateway metrics are recorded for a period of two weeks. By using these metrics, you can access historical information and get a better perspective on how your gateway and volumes are performing. Storage Gateway also provides CloudWatch alarms, except high-resolution alarms, at no additional charge. For more information about CloudWatch pricing, see Amazon CloudWatch pricing. For more information about CloudWatch, see Amazon CloudWatch User Guide.

Understanding gateway metrics

For the discussion in this topic, we define gateway metrics as metrics that are scoped to the gateway—that is, they measure something about the gateway. Because a gateway contains one or more volumes, a gateway-specific metric is representative of all volumes on the gateway. For example, the CloudBytesUploaded metric is the total number of bytes that the gateway sent to the cloud during the reporting period. This metric includes the activity of all the volumes on the gateway.

When working with gateway metric data, you specify the unique identification of the gateway that you are interested in viewing metrics for. To do this, you specify both the GatewayId and the GatewayName values. When you want to work with metric for a gateway, you specify the gateway dimension in the metrics namespace, which distinguishes a gateway-specific metric from a volume-specific metric. For more information, see Using Amazon CloudWatch Metrics.

Metric Description Applies To
AvailabilityNotifications

Number of availability-related health notifications generated by the gateway.

Use this metric with the Sum statistic to observe whether the gateway is experiencing any availability-related events. For details about the events, check your configured CloudWatch log group.

Unit: Number

All gateways.

CacheHitPercent

Percent of application reads served from the cache. The sample is taken at the end of the reporting period.

Unit: Percent

File, cached-volume, and tape gateways.

CacheUsed

The total number of bytes being used in the gateway's cache storage. The sample is taken at the end of the reporting period.

Unit: Bytes

File, cached-volume, and tape gateways.

IndexEvictions

The number of files whose metadata was evicted from the cached index of file metadata to make room for new entries. The gateway maintains this metadata index, which is populated from the AWS Cloud on demand.

Statistics: SampleCount for number of directories, SUM for total number of files, Average for average number of files per directory.

Unit: Number

File gateways only.

IndexFetches

The number of files for which metadata was fetched. The gateway maintains a cached index of file metadata, which is populated from the AWS Cloud on demand.

Statistics: SampleCount for number of directories, SUM for total number of files, Average for average number of files per directory.

Unit: Number

File gateways only.

IoWaitPercent

Percent of time that the gateway is waiting on a response from the local disk.

Unit: Percent

All gateways.

MemTotalBytes

Amount of RAM provisioned to the gateway VM, in bytes.

Unit: Bytes

All gateways.

MemUsedBytes

Amount of RAM currently in use by the gateway VM, in bytes.

Unit: Bytes

All gateways.

QueuedWrites

The number of bytes waiting to be written to AWS, sampled at the end of the reporting period for all volumes in the gateway. These bytes are kept in your gateway's working storage.

Unit: Bytes

All gateways.

ReadBytes

The total number of bytes read from your on-premises applications in the reporting period for all volumes in the gateway.

Use this metric with the Sum statistic to measure throughput and with the Samples statistic to measure IOPS.

Unit: Bytes

File, cached-volume, and stored-volume gateways.

ReadTime

The total number of milliseconds spent to do read operations from your on-premises applications in the reporting period for all volumes in the gateway.

Use this metric with the Average statistic to measure latency.

Unit: Milliseconds

File, cached-volume, and stored-volume gateways.

SmbV1Sessions

The number of Server Message Block (SMB) version 1 sessions that are active on the gateway.

Unit: Number

File gateways only.

SmbV2Sessions

The number of SMB version 2 sessions that are active on the gateway.

Unit: Number

File gateways only.

SmbV3Sessions

The number of SMB version 3 sessions that are active on the gateway.

Unit: Number

File gateways only.

TimeSinceLastRecoveryPoint

The time since the last available recovery point. For more information, see Your Cached Gateway is Unreachable And You Want to Recover Your Data.

Unit: Seconds

Cached volumes and stored volumes.

TotalCacheSize

The total size of the cache in bytes. The sample is taken at the end of the reporting period.

Unit: Bytes

File, cached-volume, and tape gateways.

UploadBufferPercentUsed

Percent use of the gateway's upload buffer. The sample is taken at the end of the reporting period.

Unit: Percent

Cached-volume and tape gateways.

UploadBufferUsed

The total number of bytes being used in the gateway's upload buffer. The sample is taken at the end of the reporting period.

Unit: Bytes

Cached-volume and tape gateways.

UserCpuPercent

Percent of CPU time spent on gateway processing, averaged across all cores.

Unit: Percent

All gateways.

WorkingStorageFree

The total amount of unused space in the gateway's working storage. The sample is taken at the end of the reporting period.

Unit: Bytes

Stored volumes only.

WorkingStoragePercentUsed

Percent use of the gateway's upload buffer. The sample is taken at the end of the reporting period.

Unit: Percent

Stored volumes only.

WorkingStorageUsed

The total number of bytes being used in the gateway's upload buffer. The sample is taken at the end of the reporting period.

Unit: Bytes

Stored volumes only.

WriteBytes

The total number of bytes written to your on-premises applications in the reporting period for all volumes in the gateway.

Use this metric with the Sum statistic to measure throughput and with the Samples statistic to measure IOPS.

Unit: Bytes

File, cached-volume, and stored-volume gateways.

WriteTime

The total number of milliseconds spent to do write operations from your on-premises applications in the reporting period for all volumes in the gateway.

Use this metric with the Average statistic to measure latency.

Unit: Milliseconds

File, cached-volume, and stored-volume gateways.

Dimensions for Storage Gateway metrics

The CloudWatch namespace for the Storage Gateway service is AWS/StorageGateway. Data is available automatically in 5-minute periods at no charge.

Dimension

Description

GatewayId, GatewayName

These dimensions filter the data that you request to gateway-specific metrics. You can identify a gateway to work by the value for GatewayId or GatewayName. If the name of your gateway was different for the time range that you are interested in viewing metrics, use the GatewayId.

Throughput and latency data of a gateway is based on all the volumes for the gateway. For information about working with gateway metrics, see Measuring Performance Between Your Gateway and AWS.

VolumeId

This dimension filters the data you request to volume-specific metrics. Identify a storage volume to work with by its VolumeId value. For information about working with volume metrics, see Measuring Performance Between Your Application and Gateway.

Monitoring the upload buffer

You can find information following about how to monitor a gateway's upload buffer and how to create an alarm so that you get a notification when the buffer exceeds a specified threshold. By using this approach, you can add buffer storage to a gateway before it fills completely and your storage application stops backing up to AWS.

You monitor the upload buffer in the same way in both the cached-volume and tape gateway architectures. For more information, see How AWS Storage Gateway Works (Architecture).

Note

The WorkingStoragePercentUsed, WorkingStorageUsed, and WorkingStorageFree metrics represent the upload buffer for stored volumes only before the release of the cached-volume feature in Storage Gateway. Now, use the equivalent upload buffer metrics UploadBufferPercentUsed, UploadBufferUsed, and UploadBufferFree. These metrics apply to both gateway architectures.

Item of Interest How to Measure
Upload buffer usage

Use the UploadBufferPercentUsed, UploadBufferUsed, and UploadBufferFree metrics with the Average statistic. For example, use the UploadBufferUsed with the Average statistic to analyze the storage usage over a time period.

To measure the percent of the upload buffer that is used

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. Choose the StorageGateway: Gateway Metrics dimension, and find the gateway that you want to work with.

  3. Choose the UploadBufferPercentUsed metric.

  4. For Time Range, choose a value.

  5. Choose the Average statistic.

  6. For Period, choose a value of 5 minutes to match the default reporting time.

The resulting time-ordered set of data points contains the percent used of the upload buffer.

Using the following procedure, you can create an alarm using the CloudWatch console. To learn more about alarms and thresholds, see Creating CloudWatch Alarms in the Amazon CloudWatch User Guide.

To set an upper threshold alarm for a gateway's upload buffer

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. Choose Create Alarm to start the Create Alarm wizard.

  3. Specify a metric for your alarm:

    1. On the Select Metric page of the Create Alarm wizard, choose the AWS/StorageGateway:GatewayId,GatewayName dimension, and then find the gateway that you want to work with.

    2. Choose the UploadBufferPercentUsed metric. Use the Average statistic and a period of 5 minutes.

    3. Choose Continue.

  4. Define the alarm name, description, and threshold:

    1. On the Define Alarm page of the Create Alarm wizard, identify your alarm by giving it a name and description in the Name and Description boxes.

    2. Define the alarm threshold.

    3. Choose Continue.

  5. Configure an email action for the alarm:

    1. On the Configure Actions page of the Create Alarm wizard, choose Alarm for Alarm State.

    2. Choose Choose or create email topic for Topic.

      To create an email topic means that you set up an Amazon SNS topic. For more information about Amazon SNS, see Set Up Amazon SNS in the Amazon CloudWatch User Guide.

    3. For Topic, enter a descriptive name for the topic.

    4. Choose Add Action.

    5. Choose Continue.

  6. Review the alarm settings, and then create the alarm:

    1. On the Review page of the Create Alarm wizard, review the alarm definition, metric, and associated actions to take (for example, sending an email notification).

    2. After reviewing the alarm summary, choose Save Alarm.

  7. Confirm your subscription to the alarm topic:

    1. Open the Amazon SNS email that was sent to the email address that you specified when creating the topic.

      The following image shows a typical email notification.

    2. Confirm your subscription by clicking the link in the email.

      A subscription confirmation appears.

Monitoring cache storage

You can find information following about how to monitor a gateway's cache storage and how to create an alarm so that you get a notification when parameters of the cache pass specified thresholds. Using this alarm, you know when to add cache storage to a gateway.

You only monitor cache storage in the cached volumes architecture. For more information, see How AWS Storage Gateway Works (Architecture).

Item of Interest How to Measure

Total usage of cache

Use the CachePercentUsed and TotalCacheSize metrics with the Average statistic. For example, use the CachePercentUsed with the Average statistic to analyze the cache usage over a period of time.

The TotalCacheSize metric changes only when you add cache to the gateway.

Percent of read requests that are served from the cache

Use the CacheHitPercent metric with the Average statistic.

Typically, you want CacheHitPercent to remain high.

Percent of the cache that is dirty—that is, it contains content that has not been uploaded to AWS

Use the CachePercentDirty metrics with the Average statistic.

Typically, you want CachePercentDirty to remain low.

To measure the percent of a cache that is dirty for a gateway and all its volumes

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. Choose the StorageGateway: Gateway Metrics dimension, and find the gateway that you want to work with.

  3. Choose the CachePercentDirty metric.

  4. For Time Range, choose a value.

  5. Choose the Average statistic.

  6. For Period, choose a value of 5 minutes to match the default reporting time.

The resulting time-ordered set of data points contains the percentage of the cache that is dirty over the 5 minutes.

To measure the percent of the cache that is dirty for a volume

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. Choose the StorageGateway: Volume Metrics dimension, and find the volume that you want to work with.

  3. Choose the CachePercentDirty metric.

  4. For Time Range, choose a value.

  5. Choose the Average statistic.

  6. For Period, choose a value of 5 minutes to match the default reporting time.

The resulting time-ordered set of data points contains the percentage of the cache that is dirty over the 5 minutes.

Understanding CloudWatch alarms

You can add CloudWatch alarms to your Storage Gateway console and monitor them visually. When an alarm is present, it turns red when it is in the ALARM state, making it easier for you to monitor its status proactively. Alarms invoke actions for sustained state changes only. Alarms don't invoke actions simply because they are in a particular state. The state must have changed and been maintained for a specified number of periods. For more information about CloudWatch alarms, see Using Amazon CloudWatch alarms.

Note

If you don't have permission to view CloudWatch, you can't view the alarms.

For each activated gateway, we recommend that you create the following CloudWatch alarms:

  • High IO wait: IoWaitpercent >= 20 for 3 datapoints in 15 minutes

  • Cache percent dirty: CachePercentDirty > 80 for 4 datapoints within 20 minutes

  • Availability notifications: AvailabilityNotifications >= 1 for 1 datapoints within 5 minutes

  • Health notifications: HealthNotifications >= 1 for 1 datapoints within 5 minutes

    Note

    You can set a health notification alarm only if the gateway had a previous health notification in CloudWatch.

The following table describes the state of an alarm.

State Description

OK

The metric or expression is within the defined threshold.

Alarm

The metric or expression is outside of the defined threshold.

Insufficient data

The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.

None

No alarms are created for the gateway. To create a new alarm, see Creating an CloudWatch alarm for Storage Gateway.

Unavailable

The state of the alarm is unknown. Choose Unavailable to view error information in the Monitoring tab.

Creating an CloudWatch alarm for Storage Gateway

CloudWatch uses Amazon Simple Notification Service (Amazon SNS) to send alarm notifications when an alarm changes state. An alarm watches a single metric over a time period you specify, and performs one or more actions based on the value of the metric relative to a given threshold over a number of time periods. The action is a notification sent to an Amazon SNS topic. You can create an Amazon SNS topic when you create a CloudWatch alarm. For more information about Amazon SNS, see What is Amazon SNS? in the Amazon Simple Notification Service Developer Guide.

To create a CloudWatch alarm in the Storage Gateway console

  1. Open the Storage Gateway console at https://console.aws.amazon.com/storagegateway/home/.

  2. In the navigation pane, choose Gateways.

  3. Choose a gateway, and then choose the alarm state or the Monitoring tab.

  4. Do one of the following:

    • If there are no alarms, choose CloudWatch Alarms.

    • If there is an existing alarm, choose Create alarm.

    The CloudWatch console opens.

  5. Create an alarm. The following are the types of CloudWatch alarms:

    • Static threshold alarm: An alarm based on a set threshold for a chosen metric. The alarm goes to ALARM state when the metric breaches the threshold for a specified number of evaluation periods.

      To create a static threshold alarm, see Creating a CloudWatch alarm based on a static threshold in the Amazon CloudWatch User Guide.

    • Anomaly detection alarm: Anomaly detection mines past metric data and creates a model of expected values. You set a value for the anomaly detection threshold, and CloudWatch uses this threshold with the model to determine the "normal" range of values for the metric. A higher value for the threshold produces a thicker band of "normal" values. You can choose whether the alarm is triggered when the metric value is above the band of expected values, below the band, or either above or below the band.

      To create an anomaly detection alarm, see Creating a CloudWatch alarm based on anomaly detection in the Amazon CloudWatch User Guide.

    • Metric math expression alarm: An alarm based one or more metrics used in a math expression. You specify the expression, threshold, and evaluation periods.

      To create a metric math expression alarm, see Creating a CloudWatch alarm based on a metric math expression in the Amazon CloudWatch User Guide.

    • Composite alarm: An alarm that determines its alarm state by watching the alarm states of other alarms. A composite alarm can help you reduce alarm noise.

      To create a composite alarm, see Creating a composite alarm in the Amazon CloudWatch User Guide.

  6. After you create the alarm in the CloudWatch console, return to the Storage Gateway console. You can view the alarm by doing one of the following:

    • In the navigation pane, choose Gateways, and then choose a gateway. On the Details tab, for Alarms, choose CloudWatch Alarms.

    • In the navigation pane, choose Gateways, then choose a gateway, and then choose the Monitoring tab.

    • In the navigation pane, choose Gateways, and then choose the alarm state of a gateway.

To edit or delete an alarm, see Editing or deleting a CloudWatch alarm.