Launching Virtual Servers with Amazon EC2 and Choosing Instance Types
This lesson explains how Amazon Elastic Compute Cloud (Amazon EC2), the most fundamental AWS compute service, provides secure, resizable virtual servers called instances.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the choices made when an instance is launched, such as the AMI and instance type.
- Distinguish the EC2 instance families and the workloads each suits.
- Interpret an instance type name such as m7g.large.
- Explain when Amazon Lightsail is the simpler choice.
Launching an instance
Launching an EC2 instance, a virtual server, involves a few choices. The Amazon Machine Image (AMI) is the template that provides the operating system and any pre-installed software, such as Amazon Linux or Windows Server. The instance type decides how much CPU, memory, storage and network capacity the server has. Storage is usually one or more EBS volumes. A security group acts as the instance's firewall, deciding which traffic may reach it, and a key pair or another method, such as Session Manager, provides access. The following table summarises these choices.
| You choose | Meaning |
|---|---|
| Amazon Machine Image (AMI) | The template with the operating system and software, e.g. Amazon Linux or Windows Server |
| Instance type | The amount of CPU, memory, storage and networking |
| Storage | EBS volumes |
| Security group | Firewall rules |
| Access | A key pair or another access method |
You can start, stop and terminate instances at any time and pay for what you run. EC2 is IaaS, so you manage and patch the operating system and installed software.
Launching an instance
Instance families
EC2 instance types are grouped into families, each designed for a kind of workload. General purpose instances balance CPU, memory and networking, and suit everyday workloads such as web servers. Compute optimised instances have powerful processors for CPU-heavy work, such as batch processing, video transcoding, game servers and scientific modelling. Memory optimised instances have large amounts of memory, for in-memory databases and real-time analysis of big data.
Accelerated computing instances add GPUs or other specialised chips, for machine learning, graphics and video. Storage optimised instances have fast local storage for workloads that read and write large amounts of data, such as data warehouses. Exam questions usually describe a workload and ask for the matching family. The following table summarises the families.
| Family | Optimised for | Examples |
|---|---|---|
| General purpose | Balanced CPU, memory and networking | Web servers, code repositories |
| Compute optimised | High-performance processors | Batch processing, media transcoding, gaming servers, scientific modelling |
| Memory optimised | Large data sets in memory | In-memory databases, real-time big data analytics |
| Accelerated computing | GPUs and other accelerators | Machine learning, graphics, video |
| Storage optimised | High, low-latency local storage I/O | Data warehousing, distributed file systems |
Which instance family?
Reading instance type names
In m7g.large: m is the family (general purpose), 7 the generation, g an extra attribute (AWS Graviton, Arm-based, often better price performance) and large the size.
Amazon Lightsail
Lightsail offers simple virtual private servers, databases and networking at predictable, low monthly prices, ideal for small websites, blogs, simple web apps and people new to AWS.
Choosing an instance family
A company runs several workloads with different resource requirements. The following table identifies the main need of each workload and the instance family that meets it.
| Workload | Main need | Instance family |
|---|---|---|
| Company website and small application servers | Balanced resources | General purpose (for example m7g) |
| Encoding thousands of videos | Raw processing power | Compute optimised (c family) |
| An in-memory database holding 500 GB | Lots of memory | Memory optimised (r or x family) |
| Training a machine learning model | GPUs | Accelerated computing (p or g family) |
| A data warehouse reading huge files from local disk | Fast local storage | Storage optimised (i family) |
| A personal blog on a fixed monthly budget | Simplicity and a predictable price | Amazon Lightsail instead of EC2 |
The instance type name tells you what you are getting: in c7g.xlarge, c is compute optimised, 7 the generation, g means a Graviton processor, and xlarge the size.
What is Amazon Lightsail?
Show answer
A simple service with virtual servers, storage and networking for a predictable monthly price, for small applications and websites.
Exam Tips
Remember for the exam
- Compute-intensive batch work or gaming servers suit compute optimised instances.
- In-memory databases and large data sets held in memory suit memory optimised instances.
- Machine learning and graphics suit accelerated computing instances with GPUs.
- High local disk I/O suits storage optimised instances.
- A simple website at a fixed monthly price suits Lightsail.
- EC2 is IaaS, so you manage the operating system.