X
    Categories: AWS

Quick guide: How to resize AWS EC2 instance Scale up


Sometimes your current EC2 instance is over utilized meaning that, resources within EC2 instance such as CPU or memory are remaining at their peak all the time. In such case you need to scale up the EC2 instance. This article will quickly guide you about how to resize AWS EC2 instance (Backed by EBS volume) to match the load on the system. In case you want to resize your root EBS volume of EC2 instance follow this link.


How to resize AWS EC2 instance

In order to resize AWS EC2 instance which backed by EBS volume, basically need stop and start of the instance. Between stop and start instance you need to change the instance type of the EC2 instance.

Keep below points in mind while changing the instance type:

  1. Its not possible to resize an instance that was launched from a PV (paravirtual) AMI to an instance type that is HVM(hardware virtual machine).
  2. Your Private IP got changed during AWS resize activity.
  3. All 64 Bit Amazon EC2 instance are supported. However only following 32 bit instance type are supported:
  • t2.nano
  • t2.micro
  • t2.small
  • t2.medium
  • c3.large
  • t1.micro
  • m1.small
  • m1.medium
  • c1.medium

So if you are resizing a 32-bit instance, you can only use above instance types.

In our demo we have currently “t2.micro” instance. which has got 1 vCPU and 1 Gb of memory. You can confirm the the same from respective OS.

[root@rhel ~]#  nproc
1
[root@rhel ~]# grep MemTotal /proc/meminfo
MemTotal:        1014960 kB
[root@rhel ~]#

To increase the number of CPU and memory you need to change the instance type of as per below specification of instance type.

Family Type vCPUs Memory (GiB) Instance Storage (GB)
General purposet2.nano10.5EBS only
General purposet2.small12EBS only
General purposet2.medium24EBS only
General purposet2.large28EBS only
General purposet2.xlarge416EBS only
General purposet2.2xlarge832EBS only
General purposem4.large28EBS only
General purposem4.xlarge416EBS only
General purposem4.2xlarge832EBS only
General purposem4.4xlarge1664EBS only
General purposem4.10xlarge40160EBS only
General purposem4.16xlarge64256EBS only
Compute optimizedc4.large23.75EBS only
Compute optimizedc4.xlarge47.5EBS only
Compute optimizedc4.2xlarge815EBS only
Compute optimizedc4.4xlarge1630EBS only
Compute optimizedc4.8xlarge3660EBS only
Memory optimizedr4.large215.25EBS only
Memory optimizedr4.xlarge430.5EBS only
Memory optimizedr4.2xlarge861EBS only
Memory optimizedr4.4xlarge16122EBS only
Memory optimizedr4.8xlarge32244EBS only
Memory optimizedr4.16xlarge64488EBS only
Memory optimizedr3.large2151 x 32 (SSD)
Memory optimizedr3.xlarge430.51 x 80 (SSD)
Memory optimizedr3.2xlarge8611 x 160 (SSD)
Memory optimizedr3.4xlarge161221 x 320 (SSD)
Memory optimizedr3.8xlarge322442 x 320 (SSD)
Memory optimizedx1.16xlarge649761 x 1920
Memory optimizedx1.32xlarge12819522 x 1920
Storage optimizedd2.xlarge430.53 x 2048
Storage optimizedd2.2xlarge8616 x 2048
Storage optimizedd2.4xlarge1612212 x 2048
Storage optimizedd2.8xlarge3624424 x 2048
Storage optimizedi2.xlarge430.51 x 800 (SSD)
Storage optimizedi2.2xlarge8612 x 800 (SSD)
Storage optimizedi2.4xlarge161224 x 800 (SSD)
Storage optimizedi2.8xlarge322448 x 800 (SSD)
Storage optimizedi3.large215.251 x 475 (SSD)
Storage optimizedi3.xlarge430.51 x 950 (SSD)
Storage optimizedi3.2xlarge8611 x 1900 (SSD)
Storage optimizedi3.4xlarge161222 x 1900 (SSD)
Storage optimizedi3.8xlarge322444 x 1900 (SSD)
Storage optimizedi3.16xlarge644888 x 1900 (SSD)

Please follow this Link in case you need more details about instance type.

So our resulted instance type will be “t2.xlarge” which will have 4 vCPUs and 16 Gb of memory.

Please follow below procedure to resize AWS EC2 instance (Backed by EBS volume only).

Step1: Take the backup.

It’s always advisable to keep the backup of the instance. You can either create AMI image or you can use snapshot to take the backup of the volume.

Step2: Stop the EC2 instance. 

  • In order to stop the instance select the particular EC2 instance in EC2 console.
  • Click on Actions then select select Instance State, and then choose Stop.
  • In the next popup dialog box, choose Yes, Stop.

Step3: Change the instance type.

  • Now select the instance, click on Actions, select Instance Settings, and then choose Change Instance Type.
  • Now select the Instance Type that you want.

Please note that incompatible instance type will not be available for selection.

  • Click on Apply to accept the new settings.

Here we have selected t2.xlarge since we need 4 vCPUs and 16 Gb of memory.

Step3: Start the EC2 instance.

  • In order to start the instance select the particular EC2 instance in EC2 console.
  • Click on Actions then select select Instance State, and then choose Start.

Confirmation:

Try to login to EC2 instance. Check the number of CPU and memory.

[root@rhel ~]# nproc
4
[root@rhel ~]#  grep MemTotal /proc/meminfo
MemTotal:       16004804 kB
[root@rhel ~]#

This confirms that, we have successfully resize AWS EC2 instance.

 

View Comments (0)

Related Post