Amazon Elastic Compute Cloud (Amazon EC2)
• Provides secure, resizable compute capacity in the cloud as Amazon EC2 instances.
Traditional on-premises resources
o Spend money upfront to purchase hardware.
o Wait for servers to be delivered to you.
o Install the servers in your physical data centre.
o Make all the necessary configurations.
Amazon EC2 instance you can use virtual server to run applications in AWS Cloud
o You can provision and launch an Amazon EC2 instance within minutes.
o You can stop using it when you have finished running a workload.
o You pay only for the compute time you use when an instance is running, not when it is stopped or terminated.
o You can save costs by paying only for server capacity that you need or want.
How Amazon EC2 Works
Launch
Connect
Use
Launch
Connect
Use
* Can run commands to install software, add storage, copy and organise files, and more.
Amazon EC2 instance types
General purpose instances
Compute optimised instances
Memory optimised instances
Accelerated computing instances
Storage optimised instances
General purpose instances
provide a balance of compute, memory, and networking resources.
• Can use them for variety of workloads: o Application servers. o Gaming servers. o Backend servers for enterprise applications. o Small and medium databases.
Compute optimised instances
– ideal for compute-bound applications that benefit from high-performance processors.
• Can use compute optimised instances for workloads e.g. web, application and gaming servers.
Memory optimised instances
designed to deliver fast performance for workloads that process large datasets in memory.
• Memory – temporary storage area.
• Holds all data and instructions that a central processing unit (CPU) needs to be able to complete actions.
• Before computer program/application able to run – loaded from storage into memory.
• Preloading process gives CPU direct access to computer program.
• Memory optimised instances enable you to run workloads with high memory needs and receive great performance.
Accelerated computing instances
use hardware accelerators/coprocessors to perform some functions more efficiently than is possible in software running on CPUs.
Storage optimised instances
– designed for workloads require high, sequential read and write access to large datasets on local storage.
• E.g. distributed file systems, data warehousing applications, high-frequency online transaction processing (OLTP) systems.
• Input/output operations per second (IOPS) is metric that measures performance of storage device.
o Indicates how many different input or output operations device can perform in one second.
o Storage optimised instances designed to deliver tens of thousands of low-latency, random IOPS to applications.
o Input operations – data put into a system e.g. records entered into database.
o Output operation – data generated by server e.g. analytics performed on records in database.
o Application has high IOPS requirement – storage optimised instance provide better performance over other instance types not optimised for this kind of use case.
Amazon EC2 Pricing
On-Demand instances
Amazon EC2 savings plans
Reserved instances
Spot instances
Dedicated hosts
On-demand instances
short-term, irregular workloads that cannot be interrupted.
No upfront costs or minimum contracts apply.
Instances run continuously until you stop them.
Only pay for only compute time you use.
Developing and testing applications and running applications that have unpredictable usage patterns.
Not recommended for workloads that last a year or longer – these workloads can experience greater cost savings using Reserved Instances.
Amazon EC2 Savings Plans
Enable you to reduce your compute costs by committing to consistent amount of compute usage for 1-year or 3-year term.
Term commitment results in savings of up to 72% over On-Demand costs.
Any usage up to the commitment is charged at the discounted Savings Plan rate.
Any usage beyond the commitment is charged at regular On-Demand rates.
Reserved instances
billing discount applied to use of On-Demand Instances in your account.
Can purchase Standard Reserved and Convertible Reserved Instances for 1-year or 3-year term.
• Scheduled Reserved Instances for a 1-year term.
• Realise greater cost savings with 3-year option.
End of Reserve Instance term – continue using Amazon EC2 instance without interruption.
Charged On-Demand rates until you do one of the following:
• Terminate the instance.
• Purchase a new Reserved Instance that matches the instance attributes (instance type, Region, tenancy, and platform).
Spot instances
– ideal for workloads with flexible start and end times or can withstand interruptions.
Use unused Amazon EC2 computing capacity.
Offer cost savings at up to 90% of On-Demand prices.
Start and stop processing job without affecting overall operations of your business.
Make Spot request and Amazon EC2 capacity available – Spot Instance launches.
Make Spot request and Amazon EC2 capacity unavailable – request not successful until capacity becomes available.
Unavailable capacity might delay launch of background processing job.
After launched Spot Instance – capacity no longer available or demand for Spot Instances increases, instance may be interrupted.
• Might not post any issues for job.
Developing and testing applications – most likely want to avoid unexpected interruptions.
Choose different EC2 instance type that is ideal for those tasks.
Dedicated hosts
physical servers with Amazon EC2 instance capacity that is fully dedicated to your use.
Can use existing per-socket, per-core, or per-VM software licenses to help maintain license compliance.
Can purchase On-Demand Dedicated Hosts and Dedicated Hosts Reservations.
Dedicated Hosts most expensive.
Scalability
Amazon EC2 Auto Scaling
Amazon EC2 Auto Scaling two approaches
Dynamic scaling
Predictive scaling
*to scale faster - use dynamic and predictive scaling together
Dynamic scaling
responds to changing demand
Predictive scaling
automatically schedules the right number of Amazon EC2 instances based on predicted demand