EC2

Elastic Cloud Computing (EC2)

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment.

  • 7x fewer downtime hours than the next largest cloud provider

  • **24 regions and 76 availability zones **globally

  • Millions of customers ranging from enterprises to startups

Things you can do with Amazon EC2 instances

1. Web hosting

Amazon EC2 can host your web siteand web application, just as you would with any other server.

2. Databases

When you need to total control your databases, Use Amazon EC2 instance as an alternative to Amazon RDS or Amazon Dynamo DB.

3. Authentication

Amazon EC2 instance can serve as authentication brokers, such as by hosting Microsoft Active Directory.

4. Anything a server can do

Having complete control over the guest OS, you can use your instances to do virtually anything you could do with any other server.

Advantages of using Amazon EC2 (Compare with traditional server)

Disposable

1. Quick Iteration Deploy and test new versions of your applications as quickly as you can request the resources. Test across a fleet of instances instead of just one or two. Speed up your entire development lifecycle by using Amazon EC2. You dont need to take a week or a month for preparing the server for your deployment.

2. Data Driven Decision - With the ability to spin up new servers on demand, you can make sure you’re pursuing the best projects, not just the ones that will conform to the hardware you have.

3. Free to make mistakes - Virtual machines make experimentation much easier and less risky. If an experiment doesn’t work out, shut down the resources it was using and stop paying for it immediately, instead of buying hardware.

EC2 Types

On-Demand

  • Pay for compute capacity per second or by the hour, depending on OS

  • No long-term commitments

  • No upfront payments

Reserved

  • Pre-pay for capacity

  • Standard Reserved Instances (RIs): Provide the most significant discount; best suited for ready state usage; least flexible type of RI

  • Convertible RIs: Moderate discount; able to change the attributes of the RI

  • Schedule RIs: RIs that launch in a time window of your choice, allowing you to match your capacity needs

  • Pay upfront with three different methods

  • Can be shared between multiple accounts

Spot

  • Bid for unused capacity

  • Prices controlled by AWS based on supply and demand

  • Termination notice provided two minutes prior to termination

  • Can provide the best discounts, but your workloads need to be able to tolerate sudden starting and stopping

EC2 instance families

  • T instancs - General-purpose instances with burstable performance

Use case: Websites, web applications, build servers, code repos, microservices, test, staging, and dev environments, business applications

  • M instances - General-purpose instances

Use case: Small and mid-size databases, data processing tasks that require additional memory, caching fleets, backend SAP servers, Microsoft SharePoint, cluster computing, other enterprise applications

  • C instances - Compute-optimized instances

Use case: High-performance web servers, high-performance computing, scientific modeling, batch processing, distributed analytics, machine/deep learning inference, ad serving, highly scalable multiplayer gaming, video encoding

  • X instances - Instances with extremely large amounts (up to almost 4 TB) of high-performance memory

Use case:In-memory databases (SAP HANA), big data processing engines (Apache Spark or Presto)

  • R instances - Instances with high-performance memory

Use case: High-performance databases, data mining and analytics, in-memory databases, distributed web scale in-memory caches, applications performing real-time processing of unstructured big data, Hadoop/Spark clusters, and other enterprise data applications

  • P instances - General-purpose GPU compute instances

Use case: Machine learning, deep learning, high-performance computing, computational fluid dynamics, computational finance, seismic analysis, speech recognition, autonomous vehicles, pharmaceutical discovery

  • F instances - Instances with customize-able hardware acceleration with field-programmable gate arrays (FPGAs)

Use case: Genomics research, financial analytics, real-time video processing, big data search and analysis, and security analytics

  • H instances - Instances with high disk throughput.

Use case: Amazon EMR-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

  • I instances - Instances backed with Non-Volatile Memory Express (NVMe) SSDs, optimized for low-latency, very high random I/O performance, and high sequential read throughput

Use case: NoSQL databases, in-memory databases (e.g. Aerospike), scale-out transactional databases, data warehousing, Elasticsearch, and analytics workloads.

  • D instances - Lowest price-per-disk throughput performance on Amazon EC2. Instances are backed by HDD-based local storage.

Use case: Massively parallel processing (MPP) data warehousing, MapReduce and Hadoop distributed computing, distributed file systems, network file systems, log or data-processing applications.

  • G instances - Instances optimized for graphics-intensive applications

Use case: 3D visualizations, graphics-intensive remote workstations, 3D rendering, application streaming, video encoding, other server-side graphics workloads

EC2 Best Practices

  • Resource tagging Help you more easily to manage, search for them, filter them when you looking for list of them.

  • Cluster Placement group If your compute layer needs the lowest possible latency and highest packer per second network performance, consider using cluster placement group.

  • Spreed placement gropu If you application have a small number of critical instances that should be kept separate from each other, consider using spread placement groups.