Committed Use Discounts (CUDs): Resource-based vs Flexible Spend
Committed Use Discounts (CUDs) là công cụ chiết khấu lớn nhất mà GCP cung cấp — lên đến 55% cho compute vCPU/memory, 70% cho memory-optimized machines. Nhưng đó cũng là công cụ dễ dàng sử dụng sai nhất: mua CUD sai cách có thể khóa chi phí cao trong 1–3 năm mà không dùng hết.
Hiểu cơ chế CUD là hiểu rằng đây là commitment contract chứ không phải "discount voucher". Khi bạn mua một CUD, bạn:
- Cam kết sử dụng một lượng tài nguyên cụ thể hoặc một mức chi phí cụ thể
- Bị tính phí hàng tháng cho commitment đó, dù bạn có sử dụng hay không
- Nhận được discount trên usage có đủ điều kiện mới
Chương này đặt nặng vào cơ chế billing thực sự: resource-based CUD áp dụng thế nào, flexible spend CUD hoạt động tại sao khác, khi nào cross-project sharing khiến CUD hiệu quả, khi nào CUD trở thành sunk cost.
Internal Model: CUD là Contract, Không phải Discount
Resource-Based CUDs: Region-Specific, Machine-Specific Commitments
Một resource-based CUD là contract bạn ký với Google để sử dụng một lượng cụ thể của tài nguyên máy tính ở một region cụ thể:
1x resource-based CUD:
- Region: us-central1
- Machine type: n2-standard-4 (4 vCPU, 16 GB memory)
- Duration: 1 year
- Monthly cost: ~$2,500 (example)
- Discount rate: 25% off on-demandKhi bạn sử dụng 1x n2-standard-4 VM ở us-central1, Google Cloud sẽ match usage của bạn với CUD này và apply discount. Nếu bạn không sử dụng, bạn vẫn bị tính phí.
Cơ chế matching: GCP dùng fleet-level matching — nếu bạn có 10 CUDs cho n2-standard-4 ở us-central1 và chạy 15 VMs, 10 VM đầu tiên nhận discount, 5 VM kế tiếp là on-demand pricing. Matching tự động, không cần configuration.
Scope: Resource-based CUD mặc định chỉ áp dụng trong một project, một region. Tuy nhiên, kể từ tháng 6/2026, tất cả billing account mới tự động có cross-project CUD sharing enabled — meaning CUD từ project A có thể cover usage ở project B nếu chúng cùng billing account.
Flexible Spend CUDs: Spend-Based, Service-Agnostic Commitments
Flexible spend CUDs hoạt động hoàn toàn khác. Thay vì commit "1x n2-standard-4 VM", bạn commit "$5,000/tháng Google Cloud spend":
1x flexible spend CUD:
- Commitment: $5,000/month
- Duration: 1 year
- Applicable to: All eligible services, all regions, all machine configs
- Discount rate: 25% (example)Cơ chế billing liên quan:
- Mỗi giờ, Google tính tổng cost eligible usage (compute, storage, networking, v.v.)
- Nếu cost < $5,000 / 730 giờ (i.e., < $6.85/giờ), usage đó là free (covered by commitment)
- Nếu cost > $6.85/giờ, phần vượt quá tính full on-demand price (không discount)
- Từ đó, bạn tiết kiệm khoảng 25% trên usage có đủ điều kiện
Eligible services: Flexible spend CUD áp dụng cho most compute và database services — Compute Engine, GKE, Cloud SQL, Spanner, Cloud Run, v.v. Không áp dụng cho Cloud Storage (storage cost riêng), egress, logging.
Discount rates: Flexible spend CUD có discount thấp hơn resource-based:
- Compute (N1, N2, E2): 28–35% (1-year), 46% (3-year)
- Memory-optimized (M1, M2): Chỉ có 3-year terms với discount
Billing Mechanics: Làm Sao Commitment được Áp Dụng
Resource-Based CUD Billing Process
Monthly billing cycle:
- Google tính tổng vCPU-months và memory-months bạn đã chạy ở us-central1
- Ví dụ: 10 n2-standard-4 VMs chạy 30 ngày = 40 vCPU-months + 160 GB-memory-months
Matching against commitments:
- Nếu bạn có 5 CUDs cho n2-standard-4 (each = 4 vCPU + 16 GB), đó = 20 vCPU + 80 GB trong commitment
- 20 vCPU được covered (discount applied), 20 vCPU overage tính on-demand
- Memory tính riêng: 80 GB được cover, 80 GB overage tính on-demand
Invoice breakdown:
Committed resources (n2-standard-4): - vCPU commitment charge: $XXX (fixed) - Memory commitment charge: $YYY (fixed) Overage (on-demand pricing): - 20 vCPU: $ZZZ - Overage memory: $WWW Total: $XXX + $YYY + $ZZZ + $WWW
Chú ý: Bạn luôn bị tính commitment charge, dù bạn chỉ dùng 5 trong 10 CUDs. Đó là sunk cost.
Flexible Spend CUD Billing Process
Hourly tracking:
- Mỗi giờ, Google tính tổng cost eligible usage (không bao gồm storage, egress, logging)
- Hourly cost = (n vCPU-hours × vCPU price) + (m GB-memory-hours × memory price) + ...
Commitment applied:
- Hourly commitment rate = $5,000 / 730 = ~$6.85/giờ
- Nếu hourly cost < $6.85, overage = 0 (cost fully covered)
- Nếu hourly cost > $6.85, overage = (hourly cost – $6.85) tính full price (không discount)
Month-end calculation:
Total eligible cost (before discount): $X Commitment cost: $5,000 If X < $5,000: Effective rate = X / X = 100% (covered by commitment) If X > $5,000: Discount on first $5,000 = ~25% Overage cost = X - $5,000 (full price, no discount)
Cross-Project & Cross-Service Sharing
Resource-Based CUD Sharing (Mới)
Trước tháng 6/2026:
- Resource-based CUD chỉ áp dụng trong 1 project, 1 region
- Multi-project scenarios cần multiple CUDs, mỗi project riêng
Sau tháng 6/2026:
- CUD sharing tự động enable cho tất cả new billing accounts
- 1 CUD ở project A (region us-central1) có thể cover usage ở project B (region us-central1) nếu chúng cùng billing account
- Điều này đáng kể giảm wastage nếu usage không balanced giữa các project
Ví dụ:
Project A: 8 VMs (n2-standard-4) running ở us-central1
Project B: 2 VMs (n2-standard-4) running ở us-central1
Total: 10 VMs
CUD purchase:
- 10x n2-standard-4 (us-central1) 1-year
Mà không sharing: Phải mua 8 CUDs cho A + 2 CUDs cho B = chậm, lãng phí
Với sharing: 10 CUDs pool chung, match against total 10 VMs → efficientFlexible Spend CUD: Cross-Service (Builtin)
Flexible spend CUDs mặc định áp dụng cross-service:
- $5,000 commitment có thể cover mix: compute + GKE + Cloud SQL + Cloud Run
- Nếu compute tháng này dùng $3,000, Cloud SQL dùng $2,500 → tổng $5,500
- $5,000 covered, $500 overage tính full price
Constraints & Limitations
Resource-Based CUD Constraints
- Commitment period: 1 year hoặc 3 year, không thể cancel sau khi purchase
- Minimum commitment: $100/tháng (typically, varies by region/resource)
- Machine type specificity: CUD là cho specific machine type. Nếu đổi từ n2-standard-4 → n2-standard-8, CUD không áp dụng cho n2-standard-8 (nó vẫn cover n2-standard-4 nếu có)
- Region lock: CUD cho us-central1 không cover us-east1. Không có flexibility cross-region
- Discount variation: Discount rate khác nhau per machine series. N1 = 25%, N2 = 25%, M1 = 30%, M2 = 30%, memory-optimized = 70%
Flexible Spend CUD Constraints
- Service limitation: Storage, egress, logging không eligible. Nếu bill 50% storage + 50% compute, flexibility CUD chỉ cover compute part
- Discount rate thấp hơn: 25–35% vs resource-based 55–70%
- Min/max commitment:
- Min: $100/month
- Max: Effective limit là tổng eligible spend (no point commit $100k nếu spend chỉ $50k)
- Unused commitment: Nếu actual spend < commitment, phần unused không refund
Trade-offs: Resource-Based vs Flexible Spend
| Aspek | Resource-Based | Flexible Spend |
|---|---|---|
| Discount rate | 55–70% (vCPU/memory) | 25–46% |
| Flexibility | Low — locked to specific machine type, region | High — any service, any region, any config |
| Minimum spend | $100/month (fixed per CUD) | $100/month (total) |
| Ideal for | Predictable, steady-state workload (e.g., web backend always 50 VMs) | Mixed/variable workload (compute + GKE + SQL varies month-to-month) |
| Risk | High — if usage drops, CUD becomes sunk cost | Lower — flexibility means higher utilization likelihood |
| Time to value | Immediate (first month) | Immediate (first month) |
| Purchase decision | Requires accurate forecast | Easier, less forecast needed |
Decision Framework
Choose resource-based nếu:
- Usage pattern highly predictable (e.g., always 50 web servers)
- Steady-state investment cho next 1–3 years
- Single machine type dominant (e.g., 80% n2-standard-4)
- Willing to accept region lock
Choose flexible spend nếu:
- Usage varies significantly (peaks & valleys)
- Multiple services (compute, GKE, SQL, Cloud Run)
- Prefer lower risk of stranded commitment
- Want simplicity (one commitment vs many)
Hybrid approach:
- Resource-based cho core, predictable workload (e.g., 40 n2-standard-4 always running)
- Flexible spend cho variable, ancillary workloads (e.g., GKE burst, batch processing)
Anti-Patterns & Failure Modes
Anti-Pattern 1: Over-Committing on Resource-Based CUDs
Situation: Forecast says "we need 100 VMs next year", purchase 100 CUDs.
Reality: Usage drops to 50 VMs due to optimization, autoscaling, or business slowdown.
Impact: 50 CUDs become sunk cost — you're paying $XXX/month for unused commitment.
Prevention: Conservative forecast (80% confidence), purchase at 80% of peak forecast, use flexible spend for upside.
Anti-Pattern 2: Forgetting Storage & Egress
Situation: Commit $10,000/month via flexible spend, assume total savings.
Reality: Bill breakdown:
- Compute: $3,000 (covered)
- Storage: $4,000 (NOT covered by flexible spend)
- Egress: $3,000 (NOT covered)
- Total: $10,000 (only $3,000 get discount)
Impact: Effective discount = 3/10 = 30% of commitment, way less than expected.
Prevention: Analyze bill breakdown before purchase. Flexible spend only useful if compute is 60%+ of bill.
Anti-Pattern 3: Not Monitoring CUD Utilization
Situation: Purchase 50 CUDs, never check if they're actually being used.
Reality: Due to autoscaling, workload migration, team changes, only 30 CUDs consistently match. 20 CUDs waste ~40% of commitment cost.
Impact: Silently paying for unused discounts.
Prevention: Monthly utilization reports via Cloud Billing → BigQuery, alerting if utilization < 80%.
Cơ Chế Match & Optimization
CUD Commitment Utilization Rate
Công cụ quan trọng: Cloud Billing → FinOps Hub hiển thị:
Commitment Utilization Rate = (Matched usage / Total commitment) × 100%Ví dụ:
- 10 CUDs cho n2-standard-4 (10 × 4 vCPU = 40 vCPU commitment)
- Actual usage: 35 vCPU-months
- Utilization: (35 / 40) = 87.5%
Target: 90–100% utilization (nếu < 85%, consider reducing commitment).
Recommender API for CUD Optimization
Google Cloud Recommender API cung cấp purchase recommendations:
gcloud recommender recommendations list \
--recommender=compute.commitmentPlanner \
--billing-account=BILLING_ACCOUNT_IDOutput gợi ý:
- Purchase 8 CUDs cho n2-standard-4 (saved $50k/year)
- Upgrade từ 1-year → 3-year cho savings thêm 20%
Practical Workflows
Evaluating CUD ROI
Capture current spend (last 3 months):
sqlSELECT service.description, SUM(cost) as total_cost FROM `project.billing_dataset.gcp_billing_export_v1` WHERE invoice_month >= '202604' GROUP BY service.description ORDER BY total_cost DESC;Identify steady-state resources (machine type distribution):
sqlSELECT resource.labels.machine_type, COUNT(*) as count, AVG(usage.amount) as avg_usage FROM `project.billing_dataset.gcp_billing_export_v1` WHERE service.description = 'Compute Engine' GROUP BY machine_type;Calculate CUD payback period:
CUD cost: $2,500 / month On-demand cost (baseline): $5,000 / month Discount: 50% Breakeven: (CUD_cost) / (On-demand_cost - CUD_cost) × 100 = 2,500 / 2,500 = 100% savings/monthCommit at utilization confidence level:
- If 95% confident usage ≥ 80 VMs: commit 80 CUDs
- If 80% confident usage ≥ 80 VMs: commit 60 CUDs, use flexible spend for upside