For an easier understanding of instance types and based on real-time cases,
AWS has grouped together instances into families based on final application usages. The following information guide will help you to think about the instance type that would be best suited as per your requirements.
[ 13 ]
AWS EC2 instances can be differentiated via three purchasing models: • On-demand instance
• Reserved instance • Spot instance
At the beginning of Cloud technology, it was first defined by its properties of elasticity and supply of infrastructure with whatever configuration the consumer needs and whenever he needs. This was the primary logic behind on-demand instances.
You don't need to pay any up-front cost, but only charges per hour plus how long you are going to run the AWS instance for. This purchasing model is very flexible, but it is also the most expensive one. If somebody requires dynamic throughput, the on-demand instance type can be the best choice for them.
If you know the exact duration for the instance to become available on AWS, accurate usage as per the instance types, and the geographical location of instances from where you can serve the content with low latency to your end users, you can go with reserved instances:
[ 14 ]
Reserved instances always start as on-demand instances but the only difference is the billing method. You have to pay a one-time fee to cut down the per hour charges at runtime. If you are going to use AWS EC2 instances all the time like 365x24x7, you will realize a drastic price reduction in billing.
The reserved instances are classified based on their utilization, for example, light utilization, medium utilization, and heavy utilization. The basic difference between these three types is their upfront cost and per hour billing. If you select a heavy utilization type, per the hour charges will be much less but the upfront cost will be higher than the light and medium utilization types.
After purchasing the reserved instance, you cannot change the platform, AZ, instance type, term period, and offering type.
Again, if you are going for light utilization, you have to pay a smaller upfront cost but the per hour charge will be increased compared to high utilization and medium utilization. The best use case is to run light and medium utilization type instances for those who often need to run a particular instance type, but not all the time.
However, after offering resources to end users over the globe, AWS has unused infrastructure in their datacenters. So AWS has decided to rent this infrastructure by bidding it. A user will come and bid for the instance, and they will get the instance resource as long as their bid is higher than the others:
[ 15 ]
In other words, in Spot instances, you can specify the maximum price based on the per hour charge you'll pay and if there is space, you will get the instance. At any point in time, if you are outbid, your instance will be snatched away from you without any prior notice. That means you can utilize these kinds of resources to finish the process when it's most economical. Spot instances can be best suited to web applications or web servers, where if one or more instances shuts down, the process won't be affected.
The Spot instances console is the same as an on demand console except the configuration step in which a user will define the bid price.
Whenever you are going to launch an instance in any region and whatever the instance type you selecting, determine the hardware of the server/instance, which will be used in your virtual infrastructure. Each and every instance type has different RAM, CPU power, and storage capacities. Among these instance types, you have to choose the most suitable instance type on which you can start hosting your software or applications. AWS EC2 gives you consistent CPU power, regardless of its whole underlying hardware infrastructure/datacenter.
AWS EC2 reserves some of the resources from its pool for the host computer, such as the CPU, memory, and some instance storage for an appropriate instance. AWS EC2 will share the remaining resources of the existing host computer, such as network and disk, among other instances. So, if any instance on a host computer tries to utilize the capacity of shared resources, each instance will receive an equal part of those shared resources. And if the resource performance and usage is under-utilized, an instance can acquire a larger share of those shared resources as it can in that period of time.
In AWS EC2, each instance will provide you with higher performance or lower performance based on that instance type and shared resource. Let's take an example. Say you select a high I/O instance type, which has a higher allocation of the shared pool of resources. Allocating a higher set of shared resources will also vary the I/O results of the instance type. For a general application that has a normal load, moderate I/O performance is sufficient. However, applications such as market trading will require a higher or more consistent I/O performance by considering an instance type that has a higher I/O performance output.
[ 16 ]
Available instance types
AWS has divided the instances based on common usage patterns, configuration families, and its configuration properties, as shown in the following image:
You can find out more about common instance categories at http://aws.amazon. com/ec2/instance-types/