Skip to main content

ECS Container Cost

:::caution v1 archive doc — the v2 equivalents live on /inventory/ecs_task This document describes v1's dedicated ECS Container Cost page (stats cards, charts, and the "Cost Calculation Basis" toggle). v2 has no dedicated page — its equivalents live on the /inventory/ecs_task inventory view: the Cost/Day/Cost/Mo columns, the daily-cost-total KPI tile, and a collapsible Cost Calculation Basis panel below the table (matching v1's toggle). The column values are a static estimate derived from the task definition's allocated cpu/memory — not from CloudWatch Container Insights utilization metrics (web/lib/inventory-derived.ts's ecs_task deriver — unit prices come from the single source web/lib/cost-basis.ts). The pricing constants and formula below ($0.04656/$0.00511, (CPU units/1024)×rate×24 + (MB/1024)×rate×24) match that static-estimate logic and are accurate — don't change those. But this document's pie chart and the "calculated from CloudWatch Container Insights metrics" claim are v1-only and don't exist in v2 (v2's estimate is static-constant based, and ephemeral-storage pricing is not reflected). The Cost by Service (CPU vs Memory) chart, however, DOES exist in v2 — rendered on /inventory/ecs_task as per-service grouped bars (FARGATE tasks only, static estimate, top 10). :::

A page for analyzing the cost of ECS Fargate tasks. Costs are calculated based on Fargate pricing and CloudWatch Container Insights metrics.

ECS Container Cost

Key Features​

Stats Cards​

  • Daily Cost (ECS): Total daily cost (cyan)
  • Monthly Estimate: Estimated monthly cost (green)
  • Running Tasks: Number of running tasks - Fargate/EC2 breakdown (purple)
  • Top Cost Service: Highest cost service (orange)

Service Cost Distribution Chart​

Pie chart showing daily cost distribution by service

Cost by Service (CPU vs Memory) Chart​

Compares CPU cost vs Memory cost per service. In v2 this renders as shared-scale grouped bars (both $ series on one scale — real proportions preserved) instead of stacked bars, with cluster/service labels, FARGATE-only scope, top 10, and a 'sampled' tag past the 500-row cap.

ECS Tasks Table​

ColumnDescription
ClusterCluster name
ServiceService name
Task IDTask ID (first 12 characters)
TypeLaunch type (FARGATE/EC2)
CPU (units)CPU units and vCPU equivalent
Memory (MB)Memory and GB equivalent
Daily CostDaily cost (Fargate only)
AZAvailability Zone

Cost Calculation Method​

Fargate Pricing (v2 actual values — ap-northeast-2 (Seoul) rates, web/lib/inventory-derived.ts)​

ResourceRateBilling Unit
vCPU$0.04656per vCPU-hour
Memory$0.00511per GB-hour
Ephemeral Storage (>20GB)$0.000111per GB-hour

These are fixed, static estimate constants applied regardless of the task's actual AWS region — the deriver does not look up a per-task region column.

Calculation Formula​

CPU Cost = (CPU Units / 1024) x $0.04656/hr x 24hr
Memory Cost = (Memory MB / 1024) x $0.00511/hr x 24hr
Daily Cost = CPU Cost + Memory Cost
Monthly Estimate = Daily Cost x 30

Calculation Example​

Fargate Task: 512 CPU units (0.5 vCPU) + 1024 MB (1 GB)

  • CPU: 0.5 vCPU x $0.04656/hr x 24hr = $0.5587/day
  • Memory: 1 GB x $0.00511/hr x 24hr = $0.1226/day
  • Total: $0.681/day ($20.44/month)

How to Use​

  1. Click Compute > Container Cost in the sidebar
  2. Review overall cost status from the stats cards
  3. Identify high-cost services from the charts
  4. Check detailed cost per task in the table
  5. Expand the "Cost Calculation Basis" section to verify calculation basis

Support Scope​

ItemSupport
Fargate Launch TypeO (cost calculation supported)
EC2 Launch TypeX (requires node cost distribution, not supported)
Spot Fargate- (based on On-Demand pricing)

Tips​

:::tip EC2 Launch Type EC2 type tasks are displayed as "N/A (EC2)". EC2 costs require node cost distribution and are currently not supported. :::

:::tip Cost Optimization If one side is significantly higher in the CPU vs Memory chart, consider adjusting the task definition. Fargate has limited CPU and Memory combinations. :::

:::tip Changing Price Settings (v1-only) The fargatePricing field of data/config.json was v1's override mechanism — it does not exist in v2. :::

:::info AI Analysis You can analyze with the AI Assistant using queries like "ECS cost analysis", "Highest cost service", "Fargate cost optimization recommendations", etc. :::