# Boost AWS Performance with EBS-Optimized Instances

Enable EBS optimization to guarantee performance between EBS volumes and EC2 instances. Learn how to find and update non-optimized instances.

**Published**

September 24, 2024

5

min read

If you want to ensure a high level of performance for your EBS volumes, pairing them with EBS-optimized instances is a smart move. You’ll see EBS volumes deliver at least 90% of their provisioned IOPS performance 99.9% of the time.

EC2 instances with EBS optimization enabled utilize an optimized configuration stack with additional, dedicated capacity for Amazon EBS I/O. This set up reduces potential disruptions between other traffic from your instance and Amazon EBS I/O.

In this guide, we’ll show you how to find your instance types that support EBS optimization but do not have it enabled. After that, we’ll explain how to enable it.

### Instances Without EBS Optimization Enabled by Default

Current generation instance types have EBS optimization enabled by default at an hourly usage fee, with no additional hourly cost for enabling optimization.

If you are running some [previous generation instance types](https://aws.amazon.com/ec2/previous-generation/), they might support EBS-optimization but charge an [hourly price for EBS optimization](https://aws.amazon.com/ec2/pricing/on-demand/) in addition to the hourly usage fee. If high performance is important for your use case, this additional charge to enable EBS optimization may be worth it.

Below is the list of EBS instance types that are not optimized by default but support it:

- c1.xlarge
- c3.xlarge, c3.2xlarge, c3.4xlarge
- g2.2xlarge
- i2.xlarge, i2.2xlarge, i2.4xlarge
- m1.large, m1.xlarge
- m2.2xlarge, m2.4xlarge
- m3.xlarge, m3.2xlarge
- r3.xlarge, r3.2xlarge, r3.4xlarge

You can query your instances in a certain region to see if any support EBS optimization but don’t have it enabled by default. You can do that by running this modified [**describe-instance-types**](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-instance-types.html) command in AWS CLI:

```
aws ec2 describe-instance-types \
--query 'InstanceTypes[].{InstanceType:InstanceType,"MaxBandwidth(Mb/s)":EbsInfo.EbsOptimizedInfo.MaximumBandwidthInMbps,MaxIOPS:EbsInfo.EbsOptimizedInfo.MaximumIops,"MaxThroughput(MB/s)":EbsInfo.EbsOptimizedInfo.MaximumThroughputInMBps}' \
--filters Name=ebs-info.ebs-optimized-support,Values=default
--output=table
```

Here’s an [example output](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html) from the **na-east-1** region:

```
-----------------------------------------------------------------------------------------
|                                  DescribeInstanceTypes                                 |
+--------------+---------------+----------------------+----------+-----------------------+
| EBSOptimized | InstanceType  | MaxBandwidth(Mb/s)   | MaxIOPS  |  MaxThroughput(MB/s)  |
+--------------+---------------+----------------------+----------+-----------------------+
|  supported   |  m2.2xlarge   |  500                 |  4000    |  62.5                 |
|  supported   |  r3.4xlarge   |  2000                |  16000   |  250.0                |
|  supported   |  m3.xlarge    |  500                 |  4000    |  62.5                 |
|  supported   |  r3.2xlarge   |  1000                |  8000    |  125.0                |
...
```

### Enabling EBS Optimization on Existing Instances

You can use the AWS Console or CLI to enable EBS optimization by setting attributes for existing EBS instances. If the instance is running, you’ll have to stop it.

But remember to create a backup of your instance to persistent storage. Otherwise, stopping the instance will erase data from instance store volumes.

#### Using AWS Console:

Follow the steps below to enable existing EBS-optimized instances using AWS Console:

1. Open to the Amazon [EC2 Console](https://console.aws.amazon.com/ec2/).

2. You’ll need to stop the running instance you want to update. Choose **Instances** from the navigation menu and select the instance you want to stop.

3. Select **Actions** > **Instance state** > **Stop instance**. Wait a few minutes for the instance to stop.

4. Next, choose **Actions** > **Instance settings** > **Change instance type** with the instance still selected.

5. To **Change instance type,** follow one of the steps below:

- If your chosen instance is EBS-optimized by default, the **EBS-optimized** option will be already selected and uneditable. There’s no action to take.
- If your chosen instance is not EBS-optimized by default but supports it, you can select **EBS-optimized** and **Apply**.
- If your chosen instance does not support EBS optimization, you won’t see it as an option. You can instead change the **Instance type** to one that supports EBS optimization, select **EBS-optimized**, then **Apply**.

6. To start the updated instance, click **Instance state** and **Start instance**.

### **Using AWS CLI:**

Follow the steps below to enable existing EBS-optimized instances using AWS CLI:

1. Stop the running instance by using the following [stop-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/stop-instances.html) command:

```
aws ec2 stop-instances
--instance-ids <value>
```

2. Next, enable EBS optimization by running the [modify-instance-attribute](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/modify-instance-attribute.html) command:

```
aws ec2 modify-instance-attribute
--ebs-optimized
```

You won’t see any output from running this command.

3. Now that you have updated your instance, you can run the [start-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/start-instances.html) command:

```
aws ec2 start-instances
--instance-ids <value>
```

Now you’ve successfully enabled EBS optimization for an existing instance. You can repeat these steps as needed.

### Enabling EBS Optimization on New Instances

#### Using AWS Console

Follow the steps below to enable new EBS-optimized instances using AWS Console:

1. Open Amazon [EC2 Console](https://console.aws.amazon.com/ec2/) on your browser and select **Launch instance**.

2. Next, select an Amazon Machine Image (AMI) and then choose an instance type that supports EBS optimization. You can see a [full list of types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html) here.

3. Complete the required fields in **Configure instance details** and select **Launch as EBS-optimized instance**. If you don’t see this option, the instance type you selected doesn’t support EBS optimization. If your chosen instance type is optimized by default, this option will already be selected and cannot be changed.

4. Complete the wizard and launch your new EBS-optimized instance.

#### Using AWS CLI

To enable the EBS-optimized setting for new instances, you can do it with the **--ebs-optimized** flag when running a [run-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/run-instances.html) CLI command:

```
aws ec2 run-instances
[--block-device-mappings <value>]
[--image-id <value>]
[--instance-type <value>]
[--ebs-optimized | --no-ebs-optimized]
```

Here’s an example:

```
aws ec2 run-instances \
    --image-id ami-0abcdef1234567890 \
    --instance-type r3.xlarge \
    --count 1 \
    --subnet-id subnet-09fx749571b3d147r \
    --security-group-ids sg-06n384b43d7d692g9 \
    --ebs-optimized \
```

In the output, you’ll see the following line as a confirmation:

```
"EbsOptimized": true,
```

### Checking for EBS Optimization with Blink

While running the command and clicking through the EC2 console isn’t hard, it requires context-switching and a lot of manual work depending on your use case. Ensuring that you have EBS optimization enabled on all EC2 instances would require you checking all regions and making manual updates.

With [Blink](/content/site-root.html), you can use [this automation](https://library.blinkops.com/automations/ensure-ec2-instance-have-ebs-optimization-enabled-in-aws) to quickly check across regions for instances without EBS optimization enabled and take action. It’s never been easier to implement a best practice across your cloud.
