Amazon Elastic Compute Cloud (Amazon EC2)

AWS EC2 has following benefits:

  • Scalable computing capacity in the Amazon Web Services (AWS) cloud.
  • No need to invest in hardware up front, so you can focus on developing and deploying applications faster.
  • Launch as many or as few virtual servers as you need, configure security and networking, and manage storage.
  • Scale up or down to handle changes in requirements or spikes in popularity depending on network traffic, time of day, popularity, thereby reducing your need to forecast traffic.

Features of Amazon EC2

Amazon EC2 provides the following features:

  • Virtual computing environments, known as instances
  • Preconfigured templates for your instances, known as Amazon Machine Images (AMIs), that package the bits you need for your server (including the operating system and additional software)
  • Various configurations of CPU, memory, storage, and networking capacity for your instances, known as instance types
  • Secure login information for your instances using key pairs (AWS stores the public key, and you store the private key in a secure place)
  • Storage volumes for temporary data that's deleted when you stop or terminate your instance, known as instance store volumes
  • Persistent storage volumes for your data using Amazon Elastic Block Store (Amazon EBS), known as Amazon EBS volumes
  • Multiple physical locations for your resources, such as instances and Amazon EBS volumes, known as regions and Availability Zones
  • A firewall that enables you to specify the protocols, ports, and source IP ranges that can reach your instances using security groups
  • Static IP addresses for dynamic cloud computing, known as Elastic IP addresses
  • Metadata, known as tags, that you can create and assign to your Amazon EC2 resources
  • Virtual networks you can create that are logically isolated from the rest of the AWS cloud, and that you can optionally connect to your own network, known as virtual private clouds (VPCs)

EC2 Pricing Models

There are 5 ways to pay for AWS EC2 Instances:

  • On Demand Instances
  • Spot Instances
  • Reserved Instances
  • Dedicated Hosts
  • Scheduled Reserved Instances

On-Demand Instances

  • You pay for compute capacity by hour
  • No long term commitments or upfront investments
  • Increase or decrease compute capacity depending on demands of application and pay the specified hourly rates for the instances used
  • Suitable for applications with spiky or unpredictable workloads
  • Best suitable for applications that are being developed or tested for the first time. Once we know that the application is compatible with EC2 instance, we can reserve that instance.

Spot Instances

  • EC2 Spot Instances allow you to bid on spare AWS EC2 computing capacity for up to 90% off the On-Demand price.
  • Spot instances are exactly identical to any other on-demand instances. The only difference between On-Demand instances and Spot Instances is that Spot instances can be interrupted by EC2 with two minutes of notification when the EC2 needs the capacity back.
  • Pricing for spot instances changes in real time as it is a function of demand and supply. AWS can terminate spot instances as soon as another bid with matching or greater value is placed by other user. In this case, you won't pay for your last partial hour of usage.
  • With Spot instances, you never pay more than the maximum price you specified. If the Spot price exceeds your maximum willingness to pay for a given instance or when capacity is no longer available, your instance will be terminated automatically (or stopped/hibernate, if you opt for this behavior on persistent request - This is a new feature provided by AWS).

  • If you need to execute workloads continuously for 1 to 6 hours, you can also specify a duration requirement when requesting Spot instances. This makes them ideal for jobs that take a finite time to complete, such as batch processing, encoding and rendering, modeling and analysis, and continuous integration.

  • However, customers should make their applications ready to handle interruptions if they are using spot instances. Below are few ways how customers handle interruptions:

    • Hadoop / EMR Based Architecture - EMR workloads can utilize spot instances by running entire Hadoop/EMR cluster on spot instances to reduce costs. In EMR Job flow, there are 3 types of Instance Groups:

      • Master Instance Group - Assings Hadoop assigns tasks to core and task nodes.

      • Core Nodes - Run Hadoop tasks and store data using HDFS.

      • Task Nodes - Run Hadoop tasks, but store no data.

      In such architectures, we can run the master & core nodes on on-demand instances and task nodes on spot instances. Hadoop will automatically re-assign map-reduce jobs from failed nodes, so loss of some task nodes isn’t a biggie for Hadoop at all.

    • Queue Based Architecture - A queue will hold the jobs to be processed and the jobs will be processed by EC2 spot instances. If the spot instance goes away and the job is now completed with respect to certain parameters, the job is re-queued. (Certain parameters like - timeout, spot instance haven't sent heartbeat since some time, etc.)

    • Checkpointing - This type of architectures write the state of the application at a persistent store like S3, EBS or RDS on periodic basis. This ensures that even if the spot instance goes away, the job done by the spot instance is available till last checkpoint.

  • Below are the list of applications suitable for spot instances:

    • Batch Processing
    • Hadoop
    • Scientific computing
    • Video and image processing and rendering
    • Web / Data crawling
    • Financial (analytics)
    • Testing

    The common theme in all of these is loss of an instance is not a catastrophe.

  • You can influence the likelihood of an instance loss through the bid price, but unless you are willing to face potentially absurd costs to guarantee 100% spot instance availability, you’ll have to come to face with the fact that: You have to be able to recover from sudden spot instance termination.

Reserved Instances

  • Provides significant discount up to 75% compared to on-demand instances.
  • Reserved instances are assigned to a specific availability zone.
  • However, you end up with long term commitment with AWS - typically from 1 year upto 3 years.
  • For applications that have stable state or predictable usage, reserved instances provide significant cost savings.
  • The cost for a reserved instance is determined by following factors:
    • Instance Details - Linux / Windows, Instance Type, AZ
    • Term Commitment - 3 years commitment offers highest discounts
    • Payment Type - Upfront (highest discount) or monthly payments

Dedicated Hosts

  • It is a physical EC2 server dedicated for your use.
  • BYOL. Hence, you can save the costs by using already purchased software licenses.
  • Only you can launch instances in this dedicated host, and no other users / companies can use this host to launch their instances. i.e. no shared tenancy, and this comes with additional host.
  • This helps in meeting compliance requirements.
  • Dedicated hosts can be purchased either on-demand or as a reservation.

Scheduled Instances

Many AWS customers run some of their mission-critical applications on a periodic (daily, weekly, or monthly), part-time basis. Here are some of the kinds of things that they like to do:

  • A bank processes salary every 15 days
  • A phone company does a multi-day bill calculation run at the start of each month.
  • A trucking company optimizes routes and shipments on Monday, Wednesday, and Friday mornings.
  • An animation studio performs a detailed, compute-intensive 3D rendering every night.

Scheduled Reserved Instances are a great fit for use cases of this type. They allow you to reserve capacity on a recurring basis with a daily, weekly, or monthly schedule over the course of a one-year term. After you complete your purchase, the instances are available to launch during the time windows that you specified.


results matching ""

    No results matching ""