CS/클라우드컴퓨팅

Lec 04-1: Intro to Amazon EC2

호프 2023. 10. 13. 19:24

Lec 04-1: Intro to Amazon EC2

Intro to Computing

Computing is the brain that makes IT application work. It collects, analyzes, processes, distributes data

 

Main Components of Computing

CPU

  • runs and processes the instructions that it is given = makes the calculation possible

RAM

  • store data, temporary storage, main memory (DRAM)

Hard drive

  • long-term storage, stores the boot files and files that you create, SSD

Network performance

  • Bandwidth: amount of data that can be sent over a specified time
  • Latency: how long it takes the data to travel

Operating System(OS)

  • every computer has operating system
  • OS is the software package that manages the computer's HW and SW

Amazon EC2 Overview

Amazon EC2 is a web service that provides resizable compute capacity in the cloud at affordable costs all around the world.

  • It provides virtual machines (= EC2 instances)
  • It gives you full control over the guest OS on each instance
  • You can launch instances of any size into an Availability Zone anywhere in the world
  • You can control incoming and outcoming traffic on instances by security groups and Elatic Load Balancing(ELB)

Amazon EC2 Benefits

  • Elastic computing: increase or decrease capacity easily
  • Complete control: full control over the server
  • Flexible hosting services
  • Integrated with most AWS services
  • Reliable, Secure, Inexpensive, Get started quickly

Amazon EC2 architecture

Region

  • physical location where AWS clusters data centers
  • each region is isolated from the other regions
    • this separation is for fault tolerance and stability
  • user can choose the region that is closest to their users to help cut down on latency

VPS (Virtual Private Cloud)

  • Amazon VPC is logically isolated virtual network.
  • EC2 instances are launched in the VPC that you choose, when set up AWS account, they give you a default VPC
  • Each VPC can have a dedicated purpose to support different environments. ex) Development VPC, Testing VPC..

Subnet

  • Subnet is a range of IP addresses in your VPC
    • Public subnet: connected to the internet <-> Private subnet: won't be connected to the internet
  • Subnets are associated with only one Availablility Zone

Security Group

  • virtual firewall for EC2 instances to control incoming and outgoing traffic

Region > VPC > Availability Zone > Subnet > Security Group > EC2 Instance

A best practice is to launch instances in multiple Availability Zones and attach an Elastic Load Balancer(ELB) which automatically distributes incoming traffic.


Instance purchasing options

On-Demand

  • Pay per second (Amazon Linux and Ubuntu) or per hour (all other os)
  • No long-term commitments, No up-front payments
  • Increase or decrease your compute capacity depending on the demands of your apps
  • Use Case
    • short-term, spiky, unpredictable workloads
    • application development or testing
  • Problem solved: The need for immediate compute capacity

Reserved Instances

  • Provide a significant discount up to 72% compared to on-demand
  • Prepay for capacity
  • Use case
    • predictable usage workloads that don't require flexibility in compute power
    • workloads that last longer than 1 year
    • users are able to make upfront payments
  • Problem solved: Provides the ability to reserve capacity ahead of time, reducing cost

Saving Plans Instances

  • Compute Saving Plans
    • most flexibility, help to reduce your cost by up to 66%
    • automatically apply to instance usage regardless of instance family, size, AZ, region, os, tenancy
  • EC2 Instance Saving Plans
    • apply to specific instance family within a specific region
    • provide the largest discount (up to 72%, same with RI)
  • Use case:
    • long time workloads
    • need flexibility computing over location or by instance power
  • Problem solved: Don't have to coordinate your RI purchases

Spot Instances

  • Purchase unused EC2 capacity
  • Up to 90% off
  • Prices controlled by AWS based on supply and demand - if supply < demand : instance will be terminated
  • Termination notice provided 2 minutes prior to termination
  • Use case:
    • Apps with flexible start and end time
    • Users with urgent computing needs for large amounts of additional capacity
  • Problem solved: Low budgeted workloads can be completed with low cost inatances, provided that interruptions can be tolerated

Tenancy

Tenancy defines how EC2 instances are distributed across the physical host hardware.

  • Shared Tenancy: instances share host hardware with instances from other accounts.
  • Dedicated Instance: isolated on host hardware that is not shared with other accounts.
  • Dedicated Host: my own physical server
    • access to manage instance placement on the host hardware
    • consistently deploy instances to the same physical server over time