> ## Documentation Index
> Fetch the complete documentation index at: https://help.nops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Rightsize EC2 Instance

> Move over-provisioned EC2 instances to a smaller or cheaper instance type that still fits the workload.

AWS Compute Optimizer analyzes how much CPU, memory, network and disk each EC2 instance uses and recommends instance types that would fit the workload at a lower cost. nOps imports these recommendations daily through AWS Cost Optimization Hub and shows the estimated monthly saving.

| | |
| - | - |
| **Cloud** | AWS |
| **Category** | Compute |
| **Service** | Amazon EC2 |
| **Action** | Rightsize |
| **Effort** | Medium |
| **Restart needed** | Yes |
| **Can be rolled back** | Yes |
| **Analysis window** | Last 14 days |
| **Source** | AWS Compute Optimizer |

## Why it matters

Instances are often sized for a peak that never comes or chosen before the workload was known. Rightsizing removes capacity you pay for but do not use.

## How nOps finds it

This recommendation comes from AWS Compute Optimizer, not from nOps. Compute Optimizer looks at the instance's CloudWatch metrics over its lookback period (14 days by default) and recommends a type that would still meet the workload's needs. Memory is only considered when the CloudWatch agent reports it.

## Before you start

AWS Compute Optimizer enabled for the account. Installing the CloudWatch agent makes memory part of the analysis, which makes the recommendation more reliable.

## How to implement

1. Review the recommended instance type and confirm it supports what the workload needs (architecture, network and storage features).
2. Test the new type outside production if you can.
3. Stop the instance, change its instance type (**Actions → Instance settings → Change instance type**), then start it.
4. For instances in an Auto Scaling group, change the launch template instead.
5. Update Terraform or CloudFormation so a later deployment does not change it back.

## Risks and considerations

* Changing the instance type needs a stop and start, so plan for downtime or do it one instance at a time.
* A smaller type has less headroom: check peaks outside the lookback window, such as month-end jobs.
* Reserved Instances or Savings Plans bought for the old type may cover the new one differently.

## FAQs

> [accordion] Why doesn't the recommendation consider memory?
>
> EC2 does not report memory to CloudWatch on its own. Install the CloudWatch agent so Compute Optimizer can include it.

## Related

* [Migrate EC2 Instance to Graviton](https://help.nops.io/inform/supported-recommendations/migrate-ec2-instance-to-graviton)
* [Upgrade EC2 Instance](https://help.nops.io/inform/supported-recommendations/upgrade-ec2-instance)
* [Replace Burstable Instances Paying Surplus CPU Credits](https://help.nops.io/inform/supported-recommendations/replace-burstable-instances-paying-surplus-cpu-credits)
* [Supported recommendations](https://help.nops.io/inform/supported-recommendations.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.