Cost Optimization

Reduce cloud costs with automated waste detection, right-sizing recommendations, and reserved instance optimization.

Overview

The cost optimization engine analyzes your knowledge graph to identify waste, right-sizing opportunities, and reserved instance optimization strategies. By combining resource metadata from discovery with usage patterns from connected monitoring tools, it provides actionable recommendations to reduce infrastructure costs.

Waste detection

The system automatically identifies common sources of cloud waste:

Waste categoryDetection method
Orphaned resourcesResources with no relationships for 30+ days
Idle computeLow CPU/memory utilization over 14 days
Unused storageVolumes unattached to any instance
Over-provisioned DBDatabase instances with low connection counts
Stale snapshotsSnapshots older than 90 days
Unattached IPsElastic IPs not associated with any resource

Right-sizing

Right-sizing recommendations analyze resource utilization against available instance types:

  • Downsize candidates -- resources consistently using less than 20% of capacity
  • Upsize candidates -- resources consistently at 80%+ utilization
  • Family migration -- moving to a more cost-effective instance family (e.g., Graviton)
  • Savings estimate -- projected monthly savings for each recommendation
# Right-sizing recommendation
{
  "resource_id": "i-abc123",
  "current_type": "t3.xlarge",
  "recommended_type": "t3.large",
  "utilization": {
    "cpu_avg": 12.4,
    "memory_avg": 34.2,
    "network_avg": 8.1
  },
  "monthly_savings": 42.50,
  "annual_savings": 510.00,
  "confidence": "high",
  "risk": "low"
}

Reserved instances

The RI optimization module analyzes usage patterns and recommends optimal reserved instance purchases:

  • Coverage analysis -- current RI coverage vs. optimal coverage
  • Purchase recommendations -- which instance types, regions, and terms to purchase
  • Payment options -- no upfront, partial upfront, all upfront comparisons
  • Savings plans -- compute savings plan vs. instance type RI analysis
  • Expiration tracking -- RI expiration dates with renewal recommendations

Cost trends track spending patterns over time:

  • Monthly spend -- cost breakdown by provider, service, and scope
  • Growth rate -- month-over-month and year-over-year cost growth
  • Budget tracking -- actual vs. budgeted spend with alerts
  • Anomaly detection -- unexpected cost spikes flagged automatically
Cost allocation tags
Ensure your cloud resources have proper cost allocation tags. Knowledge Tree can detect resources missing required cost tags and flag them for remediation.

Savings report

The savings report provides a summary of identified opportunities:

# Monthly savings report
{
  "period": "2025-06",
  "total_potential_savings": 3240.50,
  "implemented_savings": 1850.00,
  "by_category": {
    "right_sizing": { "potential": 1200.00, "implemented": 800.00 },
    "waste_removal": { "potential": 890.50, "implemented": 650.00 },
    "ri_optimization": { "potential": 1150.00, "implemented": 400.00 }
  },
  "top_recommendations": [
    {
      "resource": "i-xyz789",
      "action": "downsize to t3.medium",
      "savings": 85.00,
      "status": "pending"
    }
  ]
}