Skip to content

Cost Optimization

ravikiranpagidi edited this page May 27, 2026 · 1 revision

Cost Optimization

Purpose

This page explains how to control Alibaba Cloud spend without weakening reliability, security, or engineering productivity.

Billing Models

Model Best fit Watch out for
Pay-as-you-go Variable or short-lived workloads Idle resources still cost money.
Subscription Predictable long-running resources Overcommitting to oversized capacity.
Reserved capacity Stable baseline usage Bad fit for uncertain workloads.
Savings plans Predictable spend commitments Requires usage analysis.
Storage plans/lifecycle Storage-heavy systems Retrieval and transition costs.

Cost Optimization Checklist

Compute

  • Right-size ECS instance families and sizes.
  • Stop or delete idle ECS instances.
  • Use Auto Scaling for variable workloads.
  • Evaluate commitments only after baseline usage is known.
  • Remove unused images and snapshots.

Storage

  • Apply OSS lifecycle rules.
  • Delete old snapshots and orphaned disks.
  • Use archive classes only for suitable access patterns.
  • Compress and partition analytics data.

Network

  • Review public egress.
  • Use CDN for cacheable assets.
  • Avoid unnecessary cross-region transfer.
  • Remove unused EIPs.

Database

  • Tune queries before scaling vertically.
  • Right-size instance class and storage.
  • Review read replicas.
  • Set backup retention deliberately.

Logs And Monitoring

  • Set log retention by environment.
  • Monitor ingestion volume.
  • Avoid debug logs in production unless needed.
  • Archive or delete old logs.

Governance

  • Enforce cost allocation tags.
  • Create budget alerts.
  • Review untagged spend.
  • Assign owners for cleanup.

Data Transfer Cost

Data transfer is a common surprise. Review:

  • Public internet egress
  • Cross-region replication
  • CDN origin traffic
  • Hybrid connectivity patterns
  • Analytics exports
  • Backup replication

Log Retention Cost

Logs are valuable, but unmanaged log volume becomes expensive. Define retention by purpose:

Log type Suggested thinking
Security audit logs Longer retention based on compliance.
Application debug logs Short retention unless investigating.
Access logs Retain based on analytics and audit value.
Data pipeline logs Retain enough for replay and audit.

Cost Review Meeting Template

Workload

Name, owner, environment:

Top Cost Drivers

Compute, storage, database, network, logs:

Changes Since Last Review

New services, traffic growth, scaling events:

Optimization Candidates

Rightsizing, lifecycle, cleanup, commitments:

Risks

What cost cuts could harm reliability or security?

Decisions

Actions, owners, due dates:

Common Cost Mistakes

  • Forgetting to delete labs.
  • Unused EIPs, disks, snapshots, and databases.
  • Overprovisioning RDS or ECS before measuring.
  • No lifecycle rules on OSS.
  • High log retention for noisy debug logs.
  • Buying reserved capacity too early.
  • No cost tags.
  • Ignoring cross-region and public egress.

Interview-Ready Answer: How Would You Reduce Alibaba Cloud Cost By 30%?

"I would first identify the top spend drivers from billing and tags. Then I would remove idle resources such as unused EIPs, disks, snapshots, and test databases. Next I would right-size ECS and database instances based on metrics, apply OSS lifecycle policies, tune log retention, reduce unnecessary data transfer, and use Auto Scaling for variable workloads. For stable baseline usage, I would evaluate subscription, reserved capacity, or savings plans. I would protect reliability by measuring before changes, reviewing production risk, and tracking results through budgets and cost dashboards."

Related Pages

Action Items For Learners

  • Create a cost checklist for one lab.
  • Identify five cost drivers in a scalable web app.
  • Practice the 30% cost reduction interview answer.

Clone this wiki locally