EC2 Flashcards
What is EC2?
Amazon Elastic Compute Cloud (AWS EC2) is a web service that provides resizable compute capacity in the cloud. EC2 reduces the time required to obtain and boot new server instances to minutes allowing you to scale capacity both up and down as your computing requirements change.
What types of EC2 purchases are available?
- On Demand - fixed rate by the hours. No commitment
- Reserved - Provides you capacity reservation and offers significant discounts on the hourly charge for an instance. 1 or 3 year terms
- Spot - Enables you to bid whatever price you want for instance capacity providing for even greater savings if your application has flexible start and stop times.
- Dedicated Hosts - Physical EC2 servers dedicated for your use. Dedicated Hosts can help you reduce costs by allowing you to use your existing server bound software licenses.
What are use cases for On-demand instances?
On Demand
- Users that want the low cost and flexibility of EC2 without any up-front payments or long term commitments.
- Applications with short terms, spiky or unpredictable workloads that cannot be interrupted.
- Applications being developed or tested on EC2 for the 1st time
What are use cases for Reserved instances?
Reserved
- Applications with Steady State or predictable usage
- Applications that require reserved capacity
- Users able to make upfront payments to reduce their total capacity costs even further
What are use cases for Spot instances?
Spot
- Applications that have flexible start or end times
- Applications that are only feasible at very low compute prices
- Users with urgent CPU needs for large amount of additional capacity
-If the spot is terminated by EC2, you will not be charged for a partial hour. However if you terminate the instance yourself, you will be charged.
What are use cases for Dedicated Hosts?
Dedicated Host
- Useful for regulatory requirements that may not support multi-tenant virtualization.
- Great for licensing which does not support multi-tenancy cloud deployments
- Can be purchased on-demand
- Reservations can be up to 70% of the on demand prices
Types of EC2 Instances?
General purpose instances
Compute optimized instances
Memory optimized instances
Accelerated computing instances
Storage optimized instances
What are some benefits of EC2?
Using EC2 for compute is highly flexible, cost effective, and quick when you compare it to running your own servers on premises in a data center that you own. The time and money it takes to get up and running with on-premises resources is fairly high. When you own your own fleet of physical servers, you first have to do a bunch of research to see what type of servers you want to buy and how many you’ll need. Then you purchase that hardware up front. You’ll wait for multiple weeks or months for a vendor to deliver those servers to you. You then take them to a data center that you own or rent to install them, rack and stack them, and wire them all up. Then you make sure that they are secure and powered up and then they’re ready to be used. Only then can you begin to host your applications on top of these servers. The worst part is, once you buy these servers you are stuck with them whether you use them or not.
With EC2, it’s much easier to get started. AWS took care of the hard part for you already. AWS already built and secured the data centers. AWS has already bought the servers, racked and stacked them, and they are already online ready to be used. AWS is constantly operating a massive amount of compute capacity. And you can use whatever portion of that capacity when you need it. All you have to do is request the EC2 instances you want and they will launch and boot up, ready to be used within a few minutes. Once you’re done, you can easily stop or terminate the EC2 instances. You’re not locked in or stuck with servers that you don’t need or want. Your usage of EC2 instances can vary greatly over time. And you only pay for what you use. Because with EC2, you only pay for running instances, not stopped or terminated instances.
What is multitenancy?
This idea of sharing underlying hardware is called multitenancy.
What does the hypervisor do?
The hypervisor is responsible for coordinating this multitenancy and it is managed by AWS. The hypervisor is responsible for isolating the virtual machines from each other as they share resources from the host.
How does EC2 run?
EC2 runs on top of physical host machines managed by AWS using virtualization technology. When you spin up an EC2 instance, you aren’t necessarily taking an entire host to yourself. Instead, you are sharing the host with multiple other instances, otherwise known as virtual machines. And a hypervisor running on the host machine is responsible for sharing the underlying physical resources between the virtual machines.
What OS runs on EC2?
Windows or Linux
What can you control on an EC2?
OS, Size, Software, Networking
How does EC2 work?
Launch, connect, use
EC2 Instance Grouping and Optimization?
Each instance type is grouped under an instance family and are optimized for certain types of tasks. Instance types offer varying combinations of CPU, memory, storage, and networking capacity, and give you the flexibility to choose the appropriate mix of resources for your applications.
What are the different EC2 Instance Families?
The different instance families in EC2 are general purpose, compute optimized, memory optimized, accelerated computing, and storage optimized.
General Purpose Instance?
General purpose instances provide a good balance of compute, memory, and networking resources, and can be used for a variety of diverse workloads like web service or code repositories.
application servers
gaming servers
backend servers for enterprise applications
small and medium databases
Suppose that you have an application in which the resource needs for compute, memory, and networking are roughly equivalent. You might consider running it on a general purpose instance because the application does not require optimization in any single resource area.
Compute optimized instance?
Compute optimized instances are ideal for compute-intensive tasks like gaming servers, high performance computing or HPC, and even scientific modeling.
Like general purpose instances, you can use compute optimized instances for workloads such as web, application, and gaming servers.
However, the difference is compute optimized applications are ideal for high-performance web servers, compute-intensive applications servers, and dedicated gaming servers. You can also use compute optimized instances for batch processing workloads that require processing many transactions in a single group.
Memory optimized instances?
Similarly, memory optimized instances are good for memory-intensive tasks. Accelerated computing are good for floating point number calculations, graphics processing, or data pattern matching, as they use hardware accelerators.
Memory optimized instances are designed to deliver fast performance for workloads that process large datasets in memory. In computing, memory is a temporary storage area. It holds all the data and instructions that a central processing unit (CPU) needs to be able to complete actions. Before a computer program or application is able to run, it is loaded from storage into memory. This preloading process gives the CPU direct access to the computer program.
Suppose that you have a workload that requires large amounts of data to be preloaded before running an application. This scenario might be a high-performance database or a workload that involves performing real-time processing of a large amount of unstructured data. In these types of use cases, consider using a memory optimized instance. Memory optimized instances enable you to run workloads with high memory needs and receive great performance.
Storage optimized instances?
And finally, storage optimized are good for, can you guess it? Workloads that require high performance for locally stored data.
Accelerated computing instances use hardware accelerators, or coprocessors, to perform some functions more efficiently than is possible in software running on CPUs. Examples of these functions include floating-point number calculations, graphics processing, and data pattern matching.
In computing, a hardware accelerator is a component that can expedite data processing. Accelerated computing instances are ideal for workloads such as graphics applications, game streaming, and application streaming.
Storage optimized instances are designed for workloads that require high, sequential read and write access to large datasets on local storage. Examples of workloads suitable for storage optimized instances include distributed file systems, data warehousing applications, and high-frequency online transaction processing (OLTP) systems.
In computing, the term input/output operations per second (IOPS) is a metric that measures the performance of a storage device. It indicates how many different input or output operations a device can perform in one second. Storage optimized instances are designed to deliver tens of thousands of low-latency, random IOPS to applications.
You can think of input operations as data put into a system, such as records entered into a database. An output operation is data generated by a server. An example of output might be the analytics performed on the records in a database. If you have an application that has a high IOPS requirement, a storage optimized instance can provide better performance over other instance types not optimized for this kind of use case.
EC2 Billing options?
On-Demand, Reserved Instances, Spot Instances, Dedicated Hosts, Savings Plan
On-Demand
The first one and the one that most people are familiar with is called On-Demand. What that means is that you only pay for the duration that your instance runs for. This can be per hour or per second, depending on the instance type and operating system you choose to run. Plus, no long-term commitments or upfront payments are needed. This type of pricing is usually for when you get started and want to spin up servers to test out workloads and play around. You don’t need any prior contracts or communication with AWS to use On-Demand pricing. You can also use them to get a baseline for your average usage