EC2 Flashcards

1
Q

What is EC2?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What types of EC2 purchases are available?

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are use cases for On-demand instances?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are use cases for Reserved instances?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are use cases for Spot instances?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are use cases for Dedicated Hosts?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Types of EC2 Instances?

A

General purpose instances
Compute optimized instances
Memory optimized instances
Accelerated computing instances
Storage optimized instances

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are some benefits of EC2?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is multitenancy?

A

This idea of sharing underlying hardware is called multitenancy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the hypervisor do?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does EC2 run?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What OS runs on EC2?

A

Windows or Linux

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What can you control on an EC2?

A

OS, Size, Software, Networking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does EC2 work?

A

Launch, connect, use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

EC2 Instance Grouping and Optimization?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the different EC2 Instance Families?

A

The different instance families in EC2 are general purpose, compute optimized, memory optimized, accelerated computing, and storage optimized.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

General Purpose Instance?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Compute optimized instance?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Memory optimized instances?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Storage optimized instances?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

EC2 Billing options?

A

On-Demand, Reserved Instances, Spot Instances, Dedicated Hosts, Savings Plan

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

On-Demand

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Savings Plan

A

Savings Plan offers low prices on EC2 usage in exchange for a commitment to a consistent amount of usage measured in dollars per hour for a one or three-year term. This flexible pricing model can therefore provide savings of up to 72% on your AWS compute usage. This can lower prices on your EC2 usage, regardless of instance family, size, OS, tenancy, or AWS region. This also applies to AWS Fargate and AWS Lambda usage, which are serverless compute options that we will cover later in this course.

24
Q

Reserved Instance

A

Another option is Reserved Instances. These are suited for steady-state workloads or ones with predictable usage and offer you up to a 75% discount versus On-Demand pricing. You qualify for a discount once you commit to a one or three-year term and can pay for them with three payment options: all upfront, where you pay for them in full when you commit; partial upfront, where you pay for a portion when you commit; and no upfront, where you don’t pay anything at the beginning.

25
Q

Spot Instance

A

The next option is Spot Instances, and they allow you to request spare Amazon EC2 computing capacity for up to 90% off of the On-Demand price. The catch here is that AWS can reclaim the instance at any time they need it, giving you a two-minute warning to finish up work and save state. You can always resume later if needed. So when choosing Spot Instances, make sure your workloads can tolerate being interrupted. A good example of those are batch workloads.

26
Q

Dedicated Host

A

And finally, we have Dedicated Hosts, which are physical hosts dedicated for your use for EC2. These are usually for meeting certain compliance requirements and nobody else will share tenancy of that host.

27
Q

On-Demand 2

A

On-Demand Instances are ideal for short-term, irregular workloads that cannot be interrupted. No upfront costs or minimum contracts apply. The instances run continuously until you stop them, and you pay for only the compute time you use.

Sample use cases for On-Demand Instances include developing and testing applications and running applications that have unpredictable usage patterns. On-Demand Instances are not recommended for workloads that last a year or longer because these workloads can experience greater cost savings using Reserved Instances.

28
Q

Savings Plan 2

A

AWS offers Savings Plans for several compute services, including Amazon EC2. Amazon EC2 Savings Plans enable you to reduce your compute costs by committing to a consistent amount of compute usage for a 1-year or 3-year term. This 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 (for example, $10 an hour). Any usage beyond the commitment is charged at regular On-Demand rates.

Later in this course, you will review AWS Cost Explorer, a tool that enables you to visualize, understand, and manage your AWS costs and usage over time. If you are considering your options for Savings Plans, AWS Cost Explorer can analyze your Amazon EC2 usage over the past 7, 30, or 60 days. AWS Cost Explorer also provides customized recommendations for Savings Plans. These recommendations estimate how much you could save on your monthly Amazon EC2 costs, based on previous Amazon EC2 usage and the hourly commitment amount in a 1-year or 3-year Savings Plan.

29
Q

Reserved Instance

A

Reserved Instances are a billing discount applied to the use of On-Demand Instances in your account. You can purchase Standard Reserved and Convertible Reserved Instances for a 1-year or 3-year term, and Scheduled Reserved Instances for a 1-year term. You realize greater cost savings with the 3-year option.

At the end of a Reserved Instance term, you can continue using the Amazon EC2 instance without interruption. However, you are 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).

30
Q

Spot Instance

A

Spot Instances are ideal for workloads with flexible start and end times, or that can withstand interruptions. Spot Instances use unused Amazon EC2 computing capacity and offer you cost savings at up to 90% off of On-Demand prices.

Suppose that you have a background processing job that can start and stop as needed (such as the data processing job for a customer survey). You want to start and stop the processing job without affecting the overall operations of your business. If you make a Spot request and Amazon EC2 capacity is available, your Spot Instance launches. However, if you make a Spot request and Amazon EC2 capacity is unavailable, the request is not successful until capacity becomes available. The unavailable capacity might delay the launch of your background processing job.

After you have launched a Spot Instance, if capacity is no longer available or demand for Spot Instances increases, your instance may be interrupted. This might not pose any issues for your background processing job. However, in the earlier example of developing and testing applications, you would most likely want to avoid unexpected interruptions. Therefore, choose a different EC2 instance type that is ideal for those tasks.

31
Q

Dedicated Host

A

Dedicated Hosts are physical servers with Amazon EC2 instance capacity that is fully dedicated to your use.

You can use your existing per-socket, per-core, or per-VM software licenses to help maintain license compliance. You can purchase On-Demand Dedicated Hosts and Dedicated Hosts Reservations. Of all the Amazon EC2 options that were covered, Dedicated Hosts are the most expensive.

32
Q

Scalability

A

Scalability involves beginning with only the resources you need and designing your architecture to automatically respond to changing demand by scaling out or in. As a result, you pay for only the resources you use. You don’t have to worry about a lack of computing capacity to meet your customers’ needs.

If you wanted the scaling process to happen automatically, which AWS service would you use? The AWS service that provides this functionality for Amazon EC2 instances is Amazon EC2 Auto Scaling.

33
Q

Amazon EC2 Auto Scaling

A

If you wanted the scaling process to happen automatically, which AWS service would you use? The AWS service that provides this functionality for Amazon EC2 instances is Amazon EC2 Auto Scaling.

Amazon EC2 Auto Scaling enables you to automatically add or remove Amazon EC2 instances in response to changing application demand. By automatically scaling your instances in and out as needed, you are able to maintain a greater sense of application availability.

Within Amazon EC2 Auto Scaling, you can use two approaches: dynamic scaling and predictive scaling.

34
Q

Two types of scaling?

A

Dynamic scaling responds to changing demand.
Predictive scaling automatically schedules the right number of Amazon EC2 instances based on predicted demand.

35
Q

What are the three configuration points for Amazon EC2 Auto Scaling?

A

Minimum Capacity, desired capacity, maximum capacity

36
Q

Minimum capacity

A

you can set the minimum number of Amazon EC2 instances. The minimum capacity is the number of Amazon EC2 instances that launch immediately after you have created the Auto Scaling group.

37
Q

Desired capacity

A

Next, you can set the desired capacity at two Amazon EC2 instances even though your application needs a minimum of a single Amazon EC2 instance to run.

If you do not specify the desired number of Amazon EC2 instances in an Auto Scaling group, the desired capacity defaults to your minimum capacity.

38
Q

Maximum Capacity

A

The third configuration that you can set in an Auto Scaling group is the maximum capacity. For example, you might configure the Auto Scaling group to scale out in response to increased demand, but only to a maximum of four Amazon EC2 instances.

39
Q

With Amazon EC2 Auto Scaling, what do you pay for?

A

Because Amazon EC2 Auto Scaling uses Amazon EC2 instances, you pay for only the instances you use, when you use them. You now have a cost-effective architecture that provides the best customer experience while reducing expenses.

40
Q

What is a load balancer?

A

A load balancer is an application that takes in requests and routes them to the instances to be processed.

41
Q

What is Amazon’s load balancer?

A

Elastic Load Balancing, or ELB

42
Q

What is ELB?

A

Elastic Load Balancing is the AWS service that automatically distributes incoming application traffic across multiple resources, such as Amazon EC2 instances.

A load balancer acts as a single point of contact for all incoming web traffic to your Auto Scaling group. This means that as you add or remove Amazon EC2 instances in response to the amount of incoming traffic, these requests route to the load balancer first. Then, the requests spread across multiple resources that will handle them. For example, if you have multiple Amazon EC2 instances, Elastic Load Balancing distributes the workload across the multiple instances so that no single instance has to carry the bulk of it.

Although Elastic Load Balancing and Amazon EC2 Auto Scaling are separate services, they work together to help ensure that applications running in Amazon EC2 can provide high performance and availability.

ELB, is one of the first major managed services we’re going to talk about in this course. And it’s engineered to address the undifferentiated heavy lifting of load balancing

it runs at the Region level rather than on individual EC2 instances

ELB is automatically scalable. As your traffic grows, ELB is designed to handle the additional throughput with no change to the hourly cost. When your EC2 fleet auto-scales out, as each instance comes online, the auto-scaling service just lets the Elastic Load Balancing service know that it’s ready to handle the traffic, and off it goes. Once the fleet scales in, ELB first stops all new traffic, and waits for the existing requests to complete, to drain out. Once they do that, then the auto-scaling engine can terminate the instances without disruption to existing customers.

43
Q

What type of traffic does ELB handle?

A

Front end and back end. External and internal

44
Q

Loosely coupled example architecture?

A

Messages are sent into the queue by Application A and they are processed by Application B. If Application B fails, Application A doesn’t experience any disruption. Messages being sent can still be sent to the queue and will remain there until they are eventually processed.

Aws aims to achieve loosely coupled architecture

45
Q

Amazon Simple Queue Service or SQS

A

SQS allows you to send, store, and receive messages between software components at any volume. This is without losing messages or requiring other services to be available. Think of messages as our coffee orders and the order board as an SQS queue. Messages have the person’s name, coffee order, and time they ordered. The data contained within a message is called a payload, and it’s protected until delivery. SQS queues are where messages are placed until they are processed. And AWS manages the underlying infrastructure for you to host those queues. These scale automatically, are reliable, and are easy to configure and use.

46
Q

Amazon Simple Notification Service or SNS

A

Now, Amazon SNS is similar in that it is used to send out messages to services, but it can also send out notifications to end users. It does this in a different way called a publish/subscribe or pub/sub model. This means that you can create something called an SNS topic which is just a channel for messages to be delivered. You then configure subscribers to that topic and finally publish messages for those subscribers. In practice, that means you can send one message to a topic which will then fan out to all the subscribers in a single go. These subscribers can also be endpoints such as SQS queues, AWS Lambda functions, and HTTPS or HTTP web hooks.

Additionally, SNS can be used to fan out notifications to end users using mobile push, SMS, and email. Taking this back to our coffee shop, we could send out a notification when a customer’s order is ready. This could be a simple SMS to let them know to pick it up or even a mobile push.

In fact, it looks like my phone just received a message. Looks like my order is ready. See you soon.

47
Q

Monolithic Applications

A

Applications are made of multiple components. The components communicate with each other to transmit data, fulfill requests, and keep the application running.

Suppose that you have an application with tightly coupled components. These components might include databases, servers, the user interface, business logic, and so on. This type of architecture can be considered a monolithic application.

In this approach to application architecture, if a single component fails, other components fail, and possibly the entire application fails.

48
Q

Microservices Approach

A

In a microservices approach, application components are loosely coupled. In this case, if a single component fails, the other components continue to work because they are communicating with each other. The loose coupling prevents the entire application from failing.

When designing applications on AWS, you can take a microservices approach with services and components that fulfill different functions. Two services facilitate application integration: Amazon Simple Notification Service (Amazon SNS) and Amazon Simple Queue Service (Amazon SQS).

49
Q

What does Serverless mean?

A

AWS offers multiple serverless compute options. Serverless means that you cannot actually see or access the underlying infrastructure or instances that are hosting your application. Instead, all the management of the underlying environment from a provisioning, scaling, high availability, and maintenance perspective are taken care of for you. All you need to do is focus on your application and the rest is taken care of.

50
Q

AWS Lamda

A

AWS Lambda is one serverless compute option. Lambda’s a service that allows you to upload your code into what’s called a Lambda function. Configure a trigger and from there, the service waits for the trigger. When the trigger is detected, the code is automatically run in a managed environment, an environment you do not need to worry too much about because it is automatically scalable, highly available and all of the maintenance in the environment itself is done by AWS. If you have one or 1,000 incoming triggers, Lambda will scale your function to meet demand. Lambda is designed to run code under 15 minutes so this isn’t for long running processes like deep learning. It’s more suited for quick processing like a web backend, handling requests or a backend expense report processing service where each invocation takes less than 15 minutes to complete.

51
Q

Lamda 2

A

AWS Lambda

AWS Lambda is a service that lets you run code without needing to provision or manage servers.

While using AWS Lambda, you pay only for the compute time that you consume. Charges apply only when your code is running. You can also run code for virtually any type of application or backend service, all with zero administration.

For example, a simple Lambda function might involve automatically resizing uploaded images to the AWS Cloud. In this case, the function triggers when uploading a new image.

52
Q

How Lamda works

A

You upload your code to Lambda.

2
You set your code to trigger from an event source, such as AWS services, mobile applications, or HTTP endpoints.

3
Lambda runs your code only when triggered.

4
You pay only for the compute time that you use. In the previous example of resizing images, you would pay only for the compute time that you use when uploading new images. Uploading the images triggers Lambda to run code for the image resizing function.

53
Q

What are Containers?

A

Containers provide you with a standard way to package your application’s code and dependencies into a single object. You can also use containers for processes and workflows in which there are essential requirements for security, reliability, and scalability.

54
Q

Amazon Elastic Container Service or ECS

A

Amazon Elastic Container Service (Amazon ECS)

Amazon Elastic Container Service (Amazon ECS) is a highly scalable, high-performance container management system that enables you to run and scale containerized applications on AWS.

Amazon ECS supports Docker containers. Docker is a software platform that enables you to build, test, and deploy applications quickly. AWS supports the use of open-source Docker Community Edition and subscription-based Docker Enterprise Edition. With Amazon ECS, you can use API calls to launch and stop Docker-enabled applications.

55
Q

Amazon Elastic Kubernetes Service or Amazon EKS

A

Amazon Elastic Kubernetes Service (Amazon EKS)

Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed service that you can use to run Kubernetes on AWS.

Kubernetes is open-source software that enables you to deploy and manage containerized applications at scale. A large community of volunteers maintains Kubernetes, and AWS actively works together with the Kubernetes community. As new features and functionalities release for Kubernetes applications, you can easily apply these updates to your applications managed by Amazon EKS.

56
Q

AWS Fargate

A

AWS Fargate is a serverless compute engine for containers. It works with both Amazon ECS and Amazon EKS.

When using AWS Fargate, you do not need to provision or manage servers. AWS Fargate manages your server infrastructure for you. You can focus more on innovating and developing your applications, and you pay only for the resources that are required to run your containers.