EC2

Elastic Compute Cloud (EC2)

Provides virtual servers in the AWS cloud.

You can launch one or thousands of instances simultaneously and only pay for what you use.

EC2 Autoscaling

  • Allow you to dynamically scale your EC2 capacity up or down automatically according to defined conditions.

  • It can also perform health checks on those instances and replace them when they become unhealthy.

Types of Autoscaling

Keep instances in the same level

  • You configure the Auto scaling group to maintain the specified number of instances executing.

  • EC2 Autoscaling runs periodic integrity verifications on the running intances, and when it finds defective ones it terminates these and start new ones.

Manual scaling

  • Most basic scaling way, where you only specify the change in max/min/target capacity in the auto dimention group.

  • EC2 Autocaling will just manage the start/finish of intances to keep the capacity up to date.

Scheduled scaling

  • It auto scales based on specified date and time.

  • Useful when you know when to rise and lower the instance number, based on predictable needs.

Scaling based on demand

  • A more advanced way to scale resources.

  • Using scaling policies that allows to define parameters that control the scaling process.

  • Useful when you don't know when to rise or lower the intance number, since the demand is unpredictable.

    • For instance EC2 Autoscaling can look at CPU or memory load, and it scales up/down based on a threshold.

Predictive scaling

  • Uses EC2 Autoscaling with AWS Autoscaling to scale resource in several services.

  • Maintains availability and performance at ideal levels.

  • Uses predictive and dynamic scaling (proactive and reactive approaches).

Instance Types

  • General Purpose (T2, M3, M4): Small and mid-size databases, data processing tasks that require additional memory, caching fleets, etc.

  • Compute Optimized (C3, C4): High performance front-end fleets, web-servers, batch processing, distributed analytics, high performance science and engineering applications, etc.

  • Memory Optimized (X1, R3, R4): High performance databases, distributed memory caches, in-memory analytics, genome assembly and analysis, large deployment of SAP and etc.

  • GPU/Accelerated Computing (G3, G2): 3D application streaming, machine learning, video encoding, and other server-side graphics or GPU compite workload.

  • Storage Optimized:

    • (I3, I2): NoSQL databases like Cassandra and MongoDB, scale out transactional databases, data warehousing, Hadoop, and cluster file systems.

    • (D2): Massively Parallel Processing (MPP) data warehousing, MapReduce and Hadoop distributed computing, log or data processing applications.

Instance States

  • start

  • stop (EBS Backed only): Instance is shut down with no instance charges, still charged for EBS volumes.

  • Stop-Hibernate (EBS Backed only): Suspend-to-disk, saves RAM to EBS.

  • Reboot: Operating system reboot.

  • Terminate

Storage Options

Elastic Block Store (EBS)

  • Most common.

  • Replicated within AZ.

  • EBS volumes attached at instance launch are deleted when instance terminated.

  • EBS volumes attached to a running instance are not deleted when instance is terminated but are detached with data intact.

Instance Store

  • Temporary storage.

  • Physically attached to the host server.

  • Data NOT LOST when OS is rebooted.

  • Data LOST when:

    • Underlying drive fails.

    • Instance is terminated.

  • Do not rely on for valuable, long-term data.

  • You cannot detach and attach to another instance.

General Purpose SSD (gp2)

  • Default choice.

Provisioned IOPS SSD (io1)

  • Consistent and low-latency performance.

  • I/O intensive applications such as large relational or NoSQL databases.

Cold HDD (sc1)

  • Lowest cost per gigabyte.

Throughput Optimized HDD

  • Low cost per gigabyte.

  • Frequently accessed workloads.

EBS Snapshots

  • Point in time backup of EBS volume to Amazon S3.

  • Incremental backup.

  • Can be copied to other regions or accounts.

EBS Encryption

  • AWS Key Management Service. (KMS)

  • Data stored at rest encrypted as well as data in transit between EBS and EC2.

Last updated