# CloudWatch alarm for ECS EphemeralStorageUtilized (Fargate)

CloudWatch alarms · Updated 16 November 2026

**Short answer:** EphemeralStorageUtilized is how much of a Fargate task's ephemeral storage is in use, in gigabytes, published by Container Insights per ClusterName and ServiceName. AWS recommends alarming on the Average above a threshold you set, about 90% of the storage size, for 5 of 5 one-minute periods. A full ephemeral disk makes writes fail and usually crashes the container.

## What Fargate ephemeral storage is

Every Fargate task gets a scratch disk shared by its containers: image layers, the writable container layer, and any bind-mount volumes defined in the task. By default it is 20 GiB, and you can raise it per task definition with `ephemeralStorage.sizeInGiB` (up to 200 GiB). It disappears when the task stops.

The metric is an absolute amount, not a percentage, so the threshold must be converted from the size you configured. Container Insights also publishes `EphemeralStorageReserved`, which you can divide into `EphemeralStorageUtilized` with metric math if you prefer a percentage alarm.

Things that fill it: application logs written to files instead of stdout, temporary downloads or uploads that are never deleted, local caches with no size cap, and very large container images.

## Recommended alarm settings

| Setting | Value |
|---|---|
| Namespace | `ECS/ContainerInsights` |
| Metric | `EphemeralStorageUtilized` |
| Dimensions | `ClusterName`, `ServiceName` |
| Statistic | `Average` |
| Period | 60 seconds |
| Datapoints to alarm | 5 |
| Evaluation periods | 5 |
| Comparison operator | `GreaterThanThreshold` |
| Threshold | Depends on your situation: about 90% of the configured ephemeral storage |

From the CloudWatch [recommended alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Best_Practice_Recommended_Alarms_AWS_Services.html) list. Container Insights must be enabled on the cluster for the metric to exist.

## Working out the threshold

| Ephemeral storage | 90% threshold (GB) |
|---|---|
| 20 GiB (default) | 18 |
| 50 GiB | 45 |
| 100 GiB | 90 |

Image layers count against the space from the start, so a task with a 4 GB image begins at 4 GB used. If a service legitimately runs close to full (a cache that fills to a fixed size), alarm a little above its steady level rather than at 90%. Because the metric is averaged across the service's tasks, a single task filling its disk can be masked; the per-task metric is covered in [task ephemeral storage utilisation](https://cloudconsole.dev/alarms/ecs-insights-taskephemeralstorageutilization).

## Create it

```
# 18 GB = 90% of the default 20 GiB ephemeral storage
aws cloudwatch put-metric-alarm \
  --alarm-name prod-worker-ephemeral-storage \
  --namespace ECS/ContainerInsights \
  --metric-name EphemeralStorageUtilized \
  --dimensions Name=ClusterName,Value=prod Name=ServiceName,Value=worker \
  --statistic Average \
  --period 60 \
  --evaluation-periods 5 \
  --datapoints-to-alarm 5 \
  --threshold 18 \
  --comparison-operator GreaterThanThreshold \
  --alarm-actions arn:aws:sns:eu-west-2:123456789012:ops-alerts \
  --region eu-west-2
```

## When it fires

1. **See what is on the disk.** Use [ECS Exec](https://cloudconsole.dev/how-to/ecs-exec-into-container) and run `df -h` and `du -xh / 2>/dev/null | sort -h | tail -20`.
2. **Send logs to stdout** so the awslogs or FireLens driver ships them, rather than writing log files inside the container.
3. **Clean up temp files** in the code path that creates them, and cap local caches.
4. **Increase the size** by registering a task definition with a larger `ephemeralStorage` and updating the service.
5. Check for recently stopped tasks with disk-related errors; see [essential container exited](https://cloudconsole.dev/errors/ecs-essential-container-exited).

## Questions

### How much ephemeral storage does a Fargate task get?

20 GiB by default. You can configure up to 200 GiB in the task definition with ephemeralStorage.sizeInGiB.

### Is EphemeralStorageUtilized a percentage?

No, it is in gigabytes. Convert your percentage target to GB using the configured size, or divide by EphemeralStorageReserved with metric math.

### Do container images count against ephemeral storage?

Yes. The image layers are stored on the task's ephemeral storage, so large images reduce the space left for your data.

## When this happens away from your desk

A full task disk tends to show up as crash-looping tasks rather than a clear error. CloudConsole, a phone app for AWS, is built to show this alarm with the service's stopped tasks on a phone so the link is obvious.

[About the CloudConsole app](https://cloudconsole.dev/aws-console-app) · [Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710)

## Sources

- [Recommended alarms for AWS services (Amazon CloudWatch User Guide)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Best_Practice_Recommended_Alarms_AWS_Services.html)
- [Amazon ECS Container Insights metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-metrics-ECS.html)

## Related

- [CloudWatch alarm: ECS TaskEphemeralStorageUtilization (cluster level)](https://cloudconsole.dev/alarms/ecs-insights-taskephemeralstorageutilization)
- [CloudWatch alarm for Amazon ECS EBSFilesystemUtilization](https://cloudconsole.dev/alarms/ecs-ebsfilesystemutilization)
- [How to exec into an ECS container](https://cloudconsole.dev/how-to/ecs-exec-into-container)
- [aws ecs register-task-definition](https://cloudconsole.dev/cli/ecs-register-task-definition)
- [Essential container in task exited](https://cloudconsole.dev/errors/ecs-essential-container-exited)
- [ECS ContainerCPUUtilization alarm by container name](https://cloudconsole.dev/alarms/ecs-insights-containercpuutilization-per-service)

---

Source: https://cloudconsole.dev/alarms/ecs-insights-ephemeralstorageutilized

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
