29
All you need to know about EC2 instance
EC2 instance is an amazon virtual machine, there are many EC2 instance types, find below the main ones:
- R: apps that need a lot of RAM -in memory caches
- C: apps that need good CPU – compute / databases
- M: apps that are balanced (think medium) – general / web app
- I: apps that need good local I/O (instance storage) – databases.
- G: apps that need a GPU – video rendering / machine learning.
- T2/T3: burstable instances (up to a capacity)
- T2/T3: unlimited burst
- C: apps that need good CPU – compute / databases
- M: apps that are balanced (think medium) – general / web app
- I: apps that need good local I/O (instance storage) – databases.
- G: apps that need a GPU – video rendering / machine learning.
- T2/T3: burstable instances (up to a capacity)
- T2/T3: unlimited burst
Pricing models:
- Convertible reserved instances: long workloads with flexible instances.
- Scheduled reserved instances, example: every Thu between 3 and 6 pm.
Important: for prod environnement
Termination protection is turned off by default, you must turn it on.
Termination protection is turned off by default, you must turn it on.
EBS: 5 different types of EBS storage:

AMI Types (EBS vs instance store):
- Better I/O perofrmance
- Good for buffer / cache / scratch data / temporary content.
- On stop or termination, the instance store is lost.
- You cant resize the instance store
- Backups must be operated by the user.
- RAID0: increase performance (lots of iops), but more risk (if 1 disk fail, data lost).
- RAID1: increase fault tolerance (mirroring).
- RAID5 (not recommanded for EBS)
- RAID6 (not recommanded for EBS)
Elastic Network Interface vs Enhanced Networking vs Elastic Fabric Adapter:
- For basic networking, create a management network, use a network appliance in your VPC..
- Low cost
- ENA elastic network adapter: 100Gbps
- VF virtual function: 10Gbps
EBS encryption:
EFS: Elastic File System
Amazon FSx for Windows and for Lustre:
- Can be accessed from your on-premise infrastructure
- Can be configured to be MultiAZ (HA)
- Data is backed up daily to S3
EC2 Placement Groups:
- Pros: Low Network Latency / High network throughput
- Cons: if the rack fails, all instances fails at the same time.
- Use case: Big data job that needs to complete fast.
- Pros:
- Can span across AZs
- Reduce risk of simultaneous failure
- EC2 instances are on different physical hardware
- Cons:
- Limited to 7 instances per AZ per placement group
- Use case:
- App that needs to maximize high availability.
- Critical apps where each instance must be isolated from failure from each other
- Partitioned Placement Group: think multiple instances in partition group.
- Up to 7 partitions per AZ
- Up to 100s of EC2 instances
- The instances in a partition do not share racks with the instances in the other partitions.
- A partition failure can affect many EC2 but won’t affect other partitions.
- EC2 instances get access to the partition: information as metadata
- Use case: HDFS, HBase, Cassandra, Kafka
EC2 Hibernate.
- long running processing
- saving the RAM state
- services that take time to initialize.
EC2 Best practices
Security
Security
Storage
Resource management
Backup and recovery
29