In the modern cloud landscape, compute costs often spiral out of control due to a reliance on On-Demand pricing models. For IT students, junior engineers, and industry practitioners, mastering cost optimization is no longer optional; it is a core competency. This article guides you through a practical lab scenario where we transition from inefficient On-Demand usage to Reserved Instances (RIs) and Savings Plans (SPs). By following this structured approach, organizations can realistically target a 30% reduction in their Amazon EC2 spend without sacrificing performance or flexibility.
Understanding the Economics: On-Demand vs. Commitments
Before deploying any configuration, it is essential to understand the pricing mechanics. On-Demand instances pay by the second or hour with no long-term commitment. While flexible, they are significantly more expensive for steady-state workloads. Reserved Instances provide a discount (up to 72%) in exchange for a one- or three-year term and specific instance attributes like region, tenancy, and operating system. Savings Plans offer similar discounts but with greater flexibility regarding instance families, sizes, and even regions (for Compute Savings Plans).
The primary objective of this lab is to migrate a baseline environment from On-Demand to a hybrid model using RIs for predictable baselines and SPs for variable spikes. Note that these pricing terms and specific discount percentages depend on the current AWS commercial marketplace rules and your specific account status; always verify live rates in the AWS Pricing Calculator before committing funds.
Prerequisites and Environment Setup
To replicate this scenario safely, you will need an AWS account with billing enabled. This lab assumes a Linux-based environment (Amazon Linux 2 or Ubuntu) running on EC2. We will use a single Availability Zone for simplicity, though production environments should span multiple zones for high availability.
Required Tools:
* AWS CLI v2 installed locally.
* Access to the AWS Cost Explorer and Billing Dashboard.
* A baseline On-Demand instance already running with predictable traffic patterns (e.g., a web server processing requests every minute).
Step 1: Establishing a Baseline Spend Profile
You cannot optimize what you do not measure. The first step is to identify your “steady-state” workloads. These are applications that run continuously, such as databases, caching layers, or background workers.
Run the following command to list your running instances and their types:
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" --query 'Reservations[].Instances[*].[InstanceId,InstanceType,Placement.AvailabilityZone]' --output table
Expected Result:
The output will display a list of Instance IDs, types (e.g., t3.micro, m5.large), and their Availability Zones. Identify which instances are running 24/7. In this lab scenario, assume we have identified two m5.large instances running a web application that processes data continuously. These are prime candidates for Reserved Instances.
Step 2: Purchasing Convertible Savings Plans for Flexibility
Convertible Savings Plans offer the highest flexibility because they allow you to change instance families, sizes, and operating systems later without losing your discount. This is ideal for environments where scaling requirements might fluctuate slightly.
Navigate to the AWS Console > Cost Management > Savings Plans. Select “Purchase a Convertible Savings Plan.”
* Scope: Choose “Compute” to cover EC2, Lambda, Fargate, and batch workloads.
* Duration: Select 1 year or 3 years. Longer terms yield deeper discounts.
* Amount: Enter an amount that covers your identified baseline usage (e.g., $50/month for the two m5.large instances).
Configuration Logic:
Ensure you select “Hourly” billing granularity to match On-Demand patterns. This plan will apply a discount automatically to any EC2 instance within the scope, regardless of specific family or size changes.
Step 3: Purchasing Standard Reserved Instances for Fixed Attributes
For workloads that are absolutely fixed—where changing the instance type would violate compliance or architectural constraints—Standard RIs provide deeper discounts than Convertible plans. However, they lock you into a specific Instance Type, Tenancy, Region, and OS.
In our scenario, assume one of the m5.large instances runs a legacy database that strictly requires an EBS-optimized m5 family in us-east-1.
* Go to Cost Management > Reserved Instances > Purchase a reserved instance.
* Select “Standard” (for higher discounts) or “Convertible” (if you need some flexibility).
* Choose “Partial Upfront” payment if cash flow is a concern, though “All Upfront” yields the maximum discount.
* Match the Instance Type (m5.large), Tenancy (Default), Region (us-east-1), and OS (Linux).
Important: Ensure you link this RI to the specific instance later or let AWS associate it automatically if the attributes match perfectly. If the instance is already running On-Demand, the RI will apply a discount retroactively from the purchase date until the term ends.
Step 4: Verification and Monitoring Spend Reduction
After purchasing the commitments, you must verify that the discounts are applying. Navigate to the AWS Cost Explorer dashboard. Filter by “Service” (EC2) and view the “Savings Plans” or “Reserved Instance” breakdown.
Verification Steps:
1. Check the Cost & Usage Report in S3 if available for detailed lineage.
2. Look at the AWS Pricing Calculator to estimate expected savings based on your committed hours versus On-Demand rates.
3. Monitor the Effective Hourly Rate. If you have a m5.large running with a Convertible Savings Plan attached, the console should show an effective price lower than the standard On-Demand rate.
Illustrative Output Scenario:
* Before: Total monthly EC2 bill = $100.
* After Commitment: Monthly EC2 bill = $70 (30% reduction).
* Remaining Spend: The remaining $30 covers any unexpected On-Demand usage or variable workloads not covered by the plan.
Common Mistakes and Fixes
Even experienced practitioners make errors during cost optimization. Here are three common pitfalls:
- Mismatched Attributes on Standard RIs: If you purchase a Standard RI for
us-east-1but your instance is ineu-west-1, no discount applies.- Fix: Double-check the region and instance type before purchasing. Use AWS CLI to query existing reservations:
aws ec2 describe-reservation-offerings.
- Fix: Double-check the region and instance type before purchasing. Use AWS CLI to query existing reservations:
- Over-committing: Buying plans for 30% more usage than necessary wastes capital. If you over-commit, the excess cost is paid at On-Demand rates.
- Fix: Start with a “Partial Upfront” or smaller commitment and scale up later using the same plan if usage grows.
- Ignoring Interruption Events: Savings Plans and RIs do not protect against instance termination due to system maintenance or hardware failure.
- Fix: Ensure your architecture uses Auto Scaling Groups with health checks so that if one instance fails, a new one launches immediately, keeping the reservation active on the replacement instance.
Student Practice Task: The Hybrid Lab Challenge
To solidify these concepts, students should perform the following exercise in their sandbox accounts:
1. Launch three t3.micro instances: one for a web server (steady), one for a batch processor (variable), and one for a test environment (short-term).
2. Record the total hourly cost of all three instances for 24 hours.
3. Purchase a Convertible Savings Plan covering only the steady web server’s estimated usage.
4. Launch a new t3.micro instance that matches the web server exactly and observe if the discount applies automatically.
5. Terminate one of the batch processor instances and launch a larger m5.large in its place to test the flexibility of Convertible Savings Plans versus the rigidity of Standard RIs.
Industry Application and Final Checklist
In a real-world enterprise, cost control is an ongoing process, not a one-time setup. Teams should review their Reserved Instance coverage monthly. As business needs change, converting old Standard RIs to Convertible plans or vice versa can be done in the console without losing the remaining term value.
Final Optimization Checklist:
* [ ] Identify all steady-state workloads (>70% CPU utilization over a month).
* [ ] Calculate the break-even point for 1-year vs. 3-year terms.
* [ ] Purchase Convertible Savings Plans for flexible, multi-service workloads (Lambda + EC2).
* [ ] Purchase Standard RIs for fixed, high-priority databases in specific regions.
* [ ] Set up Budget Alerts in AWS Cost Explorer to notify if spending deviates by more than 10%.
* [ ] Document all assumptions regarding instance types and OS versions to avoid attribute mismatches.
By systematically applying Reserved Instances and Savings Plans, engineers can transform their cloud bill from a variable expense into a predictable operational cost, achieving significant savings while maintaining the agility required in modern DevOps environments.
Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.

