Amazon (EC2) Elastic Compute Cloud: A Nice Overview

Amazon Elastic Compute Cloud, also known as Amazon EC2, is a scalable virtual computing environment.

The compute environment(virtual server), which Amazon calls as ‘instance’, comes with several preset configurations of CPU, memory, storage, and networking capacity.

Amazon EC2 supports both Linux and Windows Server operating systems.

Amazon offers a wide range of instance types designed to address specific business cases. For example, a General purpose instance would be great to run normal workloads and for development environments, while a memory-optimized instance can be used to memory intensive applications such as real-time big data analytics, enterprise applications and for high-performance databases.

Available Type of Instances: General Purpose, Compute Optimized, Memory Optimized, Accelerated Computing and Storage Optimized.

Instances can be further classified based on their performance: Fixed Performance Instance, where the CPU performance is limited and burstable performance instances, where CPU has the ability to go over the base limit.

When to use Fixed performance instance vs Burstable Performance:

Many applications such as web servers, developer environments and small databases don’t need consistently high levels of CPU, but benefit significantly from having full access to very fast CPUs when they need them.

If you need consistently high CPU performance for applications such as video encoding, high volume websites or HPC applications, Amazon recommends  use of Fixed Performance Instances.

Burstable instances are designed to perform as if they have dedicated high speed Intel cores available when the application really needs CPU performance, while protecting it from the variable performance or other common side-effects of over-subscription in other environments.

Example uses based on instance types.

General Purpose instances A1, T3, T2, M5, M5a, M4, T3a

Web servers, microservices, caching fleets, distributed data stores, development environments, virtual desktops, code repositories, small and mid-size databases, cluster computing and enterprise applications

Compute Optimized instances C5, C5n, C4

High performance web servers, scientific modelling, science and engineering applications, batch processing, distributed analytics, high performance computing, machine learning, multiplayer gaming, ad serving and video encoding,

Memory Optimized instances R5, R5a, R4, X1e, X1, High Memory, z1d

Memory intensive applications such as high-performance databases, distributed web-scale in-memory caches, in memory databases (ex. SAP HANA), real-time big data analytics, real-time processing of unstructured big data, data mining and analysis, Hadoop/Spark clusters, enterprise applications and large enterprise databases, electronic design automation and certain relational database workloads.

Accelerated Computing instances P3, P2, G3, F1

Machine learning, deep learning, high-performance computing, computational fluid dynamics, computational finance, financial analytics, seismic analysis, molecular modeling, rendering, speech recognition, autonomous vehicles, genomics, drug discovery, server-side GPU compute workloads, 3D visualizations, graphics-intensive remote workstation, 3D rendering, application streaming, video encoding, server-side graphics workloads, real-time video processing, big data search and analysis, and security

Storage Optimized instances H1, I3, D2

MapReduce-based workloads, distributed file systems such as HDFS and MapR-FS, network file systems, log or data processing applications such as Apache Kafka, big data workload clusters, NoSQL databases (e.g. Cassandra, MongoDB, Redis), in-memory databases (e.g. Aerospike), scale-out transactional databases, data warehousing, Elasticsearch, analytics workloads, Massively Parallel Processing (MPP) data warehousing, MapReduce and Hadoop distributed computing, distributed file systems, network file systems, log or data-processing applications

Amazon EC2 Auto Scaling:

Auto Scaling feature allows customers to automatically scale capacity up or down based on predefined conditions. This helps users to scale up capacity to meet demand spikes and automatically scale down when there is low demand. Since you will only be paying for capacity used, auto scaling helps reduce overall costs.

AWS EC2 Pricing:

Amazon uses the pay as you go pricing model for its services, which means you only pay for the resources you have consumed every hour for a given month. Amazon displays pricing on an hourly rate, but depending on the type of instance used, you will pay by the hour or by the second for each instance.

There are four ways to pay for Amazon EC2 services and there is a free tier for new customers as well.

On-demand: Billed for the compute capacity used by the hour or per second. No upfront payment and you can cancel anytime you want. Rates will be higher than reserved instances.

Reserved instances: Though the discounts can sometimes run up to 75% compared to on-demand instance pricing, customers have to commit one to three years of usage. Savings over on-demand instance increases with the amount of upfront payment you make. For example, a1.medium instance with a partial upfront payment and 1-year contract saves 40% compared to on-demand, but if you make full payment upfront for a 3-year term, you will save 62%.

If you are worried about vendor lock-in, you will have to sacrifice the lower cost advantage provided by long term reserved instances.

Spot Instance: Amazon EC2 spot instances are designed to take advantage of excess capacity available within the EC2 fleet. Through spot instances, Amazon offers spare compute capacity available at its disposal at a discount compared to on-demand instances.

Amazon EC2 retains the right to take back the capacity provided through spot instance with a two-minute notice. According to AWS, Spot Instance can be used for “various fault-tolerant and flexible applications, such as big data, containerized workloads, high-performance computing (HPC), stateless web servers, rendering, CI/CD and other test & development workloads”.

Monitoring:

Amazon EC2 customers can use Amazon Cloudwatch to monitor real- time resource utilization. CloudWatch records operational data in the form of logs, metrics, and events, giving you single point access to monitor the health of all resources, applications, and services that run on Amazon Web Services.

For more information please visit Amazon Cloudwatch

Amazon Machine Images (AMI)

Launching a virtual server (instance) on AWS is a simple process. You can either create your own Amazon Machine Image that has your applications, libraries, data, and configuration settings or select a pre-configured AMI to launch your instance. You can launch single or multiple instances using a single AMI.

EC2 and AMI, cuts the time required to obtain and boot new server instances to minutes, which in turn makes it easier to increase and reduce capacity quickly.

Important Amazon EC2 Features

  • Preconfigured compute environments
  • Temporary data storage
  • Persistent  storage via Amazon Elastic Block Store
  • Ability to launch resources in multiple regions
  • Firewall
  • Bare Metal Servers that give direct access to the processor and memory of the underlying server. 
  • Elastic IP Addresses
  • Auto Scaling
  • High-Performance Computing Clusters
  • AWS Privatelink to help customers privately access their EC2 instances