EC2 - seanremenyi/Notes_aws_developer GitHub Wiki
Elastic Compute Cloud
Definition: Secure Resizable compute capacity in the cloud, it is essentially a VM hosted in AWS
Advantages:
- You pay only for what you use, therefore no wasted capacity
- You are able to spin up servers in minutes (not in months as it traditionally was)
- Can grow and shrink as you need
Pricing options:
On Demand
- You can pay by hour or second depending on the instance
- flexible
- low cost
- no upfront payment
- no long term commitment
- Good for short term/spikey/unpredictable workloads but that you don't want to be interrupted
- Good for applications in development/testing
Reserved instance
- reserve for 1 or 3 years
- 72% discount
- Regional, if you reserve 10 instances in one region but want to spin up one in another region, it won't count as part of your reservation and you will have to pay extra
- Great for predictable usage
- Good for specific capacity requirements
- good if you can pay up front (cheaper! Woohoo!)
Reserved instance, Standard:
- up to 72% off on-demand
- Cons: What if demand changes and you need to upgrade
Reserved instance, Convertible:
- up to 54% off on-demand can be changed to a different reserved instance of equal or greater value
Reserved instance, Scheduled:
- launch within a time window you define
- if you want only in a time frame
- predictable time you know
Spot:
- purchase unused capacity
- discount up to 90%.
- price fluctuates
- You set a maximum price you are willing to pay. If cost exceeds that price, instance can be terminated or hibernated
- Not suitable for every applications
- Good for flexible start/end times
- Applications only feasible if you don't have large computing costs
- good for urgent jobs
- Use cases: image rendering/calculations
Dedicated
- Physical server dedicated for YOUR use.
- Most expensive
- Great for compliance/regulatory requiremnts
- Licensing
- can purchase as on-deman or reserved
Savings Plans
- save up to 72% regardless of type/region
- Commit to 1 or 3 years use of specific compute power (calculated in $ per hour)
- also covers Lambda, fargate, serverless technologies as well as ec2
- Pricing Calculator: great for estimating costs Turn off if you no longer need a service
Instance types
- Hardware type determines the hardware of the host for the instance
- Grouped by capabilities like cpu, memory, storage grouped in "families" (awww cute)
- Requirements, select type based on the requirements of your application that you plan on running on it
General Purpose:
AWS says
- provides balance of compute/memory and network resources
- recommended: small and medium databases, data processing tasks that require additional memory, caching fleets and or for running backend servers for SAP, Microsoft Sharepoint and other enterprise applications
- Instance name: t2, t is type and number is generation
Micro Instances:
AWS says
- type t3.micro
- eligible for free tier for the first 12 months of your account, 750 hours of micro insances each month
- great for starting out
- if you exceed then pay as you go
- low cost/low throughput or small applications
Compute optimized:
AWS says
- type C
- higher ratio of vCPU to memory than other families
- Recommend for running CPU-bound scale out applications. applications include high traffic front end fleets, on-demand batch processing, distributed analytics, web servers, batch processing and high performance science and engineering applications
FPGA (field programmable gate arrays):
AWS says
- type f
- can be programmed to create application specific hardware acceleration, along with high CPU performance, large memory and high network bandwidth for applications requiring massively parallel processing power such as genomics, data analytics, video processing and financial computing
- example accelerate analytics on trading
GPU (graphics processing units)
AWS says
- type g and p
- high CPU and network performance for applications benefitting from highly parallelized processing, including 3D graphics, HPC, rendering, and media processing applications
Machine learning ASIC (application specific integrated circuit):
AWS says
- type inf (inferenture)
- powered by chips custom built by AWS
- optimized for machine learning applications such as image recog, speech recog, natural language processing and personalization
Memory optimizes:
AWS says
- type r, x and z
- Memory optimized
- lowest cost per GB of RAM among ec2 types
- Recommended for database application, memcached and other distributed cases and larger deployments of enterprise applications like SAP and Microsoft Sharepoint
Storage Optimized:
AWS says
- type d, i and h
- Provides direct-attached storage options optimized for applications with specific I/O and storage capacity requirements.
- Recommend I instances for NoSQL database which benefit from very high random I/O performance, low request latency of direct-attached NVMe SSDs
- Recommend D instances for running large-scale data-warehouse or parallel file systems
AMI
- EC2s use Amazon machine image (AMIs) which includes OS, utilities/libraries