Skip to content

Latest commit

 

History

History
158 lines (129 loc) · 4.98 KB

File metadata and controls

158 lines (129 loc) · 4.98 KB

Public IP, Private IP, Elastic IP

  • PUBLIC IP :

    • machine identified on www
    • unique across whole web
    • can be geo located
  • PRIVATE IP :

    • machine identified on private network
    • unique across private network
    • two different networks can have same private IP
    • only specified range of IPs can be used
    • machines connect to www via NAT device + internet gateway (proxy)
  • ELASTIC IP :

    • On stopping and restarting an EC2 instance, its public IP changes
    • Elastic IP is a fixed public IPv4 IP for the instance that doesn't change until the instance is deleted
    • can be attached to one instance at a time
    • You can only have 5 elastic IP in your account
    • DISADVANTAGE : reflects poor architectural decisions
    • ALTERNATIVES :
      • using random public IP and register a DNS name to it
      • using load balancer
  • In general, an EC2 instance has

    • a private IP -> internal AWS network
    • a public IP -> www
  • Public IP has to be used to SSH into EC2 instance as we are not in same network to use private IP

Placement Groups

  • The strategy of how to place the EC2 instance within the AWS infrastructure can be defined using placement groups

  • 3 strategies for the group :

    • CLUSTER :

      • instances grouped together in a low latency hardware setup within single AZ
      • ADVANTAGE :
        • high performance
        • super low latency
        • great network speed
      • DISADVANTAGE :
        • high risk
        • one hardware fails, all instances fail
      • USE CASE :
        • big data job
        • an application that requires extremely low latency and high network throughput
    • SPREAD :

      • instances spread across different hardware

      • instances' failure are isolated

      • ADVANTAGE:

        • minimized risk of simultaneous failure
        • span across multiple AZ
      • DISADVANTAGE :

        • can have only 7 EC2 instances per placement group per AZ
      • USE CASE :

        • application requiring high availability
        • CRITICAL APPLICATIONS
    • PARTITION :

      • instances spread across different partitions; partitons spread across different sets of hardware within an AZ

      • instances' failure are not isolated but one partition isolated from another partition of failure

      • can have & partitions per AZ

      • ADVANTAGE :

        • span across multiple AZ in single region
        • run 100s of EC2 instances
        • each partition failure is isolated
        • EC2 instances get access to partition info as metadata
      • USE CASE :

        • HDFS
        • Hadoop
        • Cassandra
        • Kafka

Elastic Network Interfaces (ENI)

  • represents virtual network card
  • a logical component in a VPC
  • they give EC2 instances access to the network
  • ENI has :
    • Primary private IPv4
    • one or more secondary IPv4
    • one elastic IPv4 per private IPv4
    • one public IPv4
    • one or more security groups
    • a MAC address
  • can create ENI independently and attach them to EC2 instances on the fly (move them) when a failover occurs
  • bound to a specific AZ

EC2 Hibernate

  • on starting an EC2 instance,
    • OS boots and EC2 user data script runs
    • OS boots up
    • application starts
    • caches get warmed up
  • this takes time
  • on hibernating EC2 instance,
    • in-memory (RAM) state is preserved
    • instance boot will be faster
    • the RAM state is written to a file in root EBS volume
    • root EBS volume must have enough space and must be encrypted
  • USE CASES :
    • for long-running process
    • saving RAM state
    • (faster boot up) services that take time to initialize
  • instance RAM size must be less than 150 GB
  • Hibernation not more than 60 days

EC2 Nitro

  • next gen of EC2 instances
  • uses new virtualization technology
  • allows better performance
  • better networking options:
    • enhanced networking
    • HPC
    • uses IPv6
  • higher speed EBS -> increased level of IOPS (IO operations per seconds)
  • better security
  • instance types : c5, c6, D3, M5 types

vCPUs

  • multilple threads run on one CPU
  • each thread is a vCPU
  • eg : m5.2xlarge
    • 4 CPU
    • 2 threads per CPU
    • => 8 vCPUs
  • you may need to change no of vCPUs to:
    • decrease no of CPU cores
    • decrease no of threads per Core

EC2 capacity reservations

  • if you need to plan in advance for capacity and make sure that you can launch instances in an AZ of a specific type around the specific timeframe then use EC2 capacity reservations.

  • get billed as soon as it starts

  • no planned end-date for reservation

  • specify :

    • AZ
    • no of instances
    • instance attributes
      • type
      • tenancy
      • platform/OS

NOTE

  • Spot Fleet is a set of Spot Instances and optionally On-demand Instances. It allows you to automatically request Spot Instances with the lowest price.