Welcome to our third blog post in an ongoing series titled Mastering AWS Cloud Infrastructure. In this post, we will delve into the various compute services offered by AWS, with a particular focus on Elastic Compute Cloud (EC2). By the end of this blog, you’ll have a clear understanding of how to choose the right EC2 instance size, optimise costs, and leverage AWS’s powerful tools to enhance your cloud infrastructure. 

 

Overview of Compute Services in AWS 

 

AWS offers a variety of compute services, including virtual servers (EC2), serverless computing (Lambda), container orchestration (ECS, EKS), and batch processing (Batch), allowing users to choose the right solution for their specific needs. 

 

Each of these services can be consumed for specific use cases based on the needs of the business and applications being delivered. 

 

Popular examples of these compute services include: 

 

  • Amazon EC2 (Elastic Compute Cloud) – Provides scalable and resizable compute capacity in the cloud, allowing you to provision virtual servers (instances) to run applications. 
  • AWS Lambda – A serverless compute service that lets you run code without provisioning or managing servers, executing code only when needed and scaling automatically. 
  • Amazon ECS (Elastic Container Service) – A container orchestration service that simplifies deploying, managing, and scaling containerised applications using Docker containers. 
  • Amazon EKS (Elastic Kubernetes Service) – A managed service that simplifies running Kubernetes on AWS, automating containerised applications’ deployment, scaling, and management. 
  • AWS Outposts – A service that extends AWS infrastructure, services, APIs, and tools to customer premises. 

 

In this blog, we will focus on the Elastic Compute Cloud service, commonly known as EC2. 

 

Elastic Cloud Compute (EC2) 

 

As highlighted in the first blog of this series, Introduction to AWS Cloud Infrastructure, EC2 is an Infrastructure as a Service (IaaS) product which allows you to deploy VM type servers (known as “instances”) hosting your applications and services. These instances come in a variety of different family types that offer various CPU and memory setups as well as other optimised features. For example, the AWS HPC family instances are designed for High Performance Computing and will have both high CPU and memory allocations as well as access to high-speed network interfaces and bandwidth. 

 

The following table shows an overview of the EC2 instance families available: 

 

Instance Family  Description  Use Cases 
General Purpose  Balanced compute, memory, and networking resources.  Web servers, code repositories, small databases. 
Compute Optimised  High-performance processors for compute-intensive tasks.  High-performance web servers, scientific modelling, batch processing. 
Memory Optimised  Large memory sizes for memory-intensive applications.  In-memory databases, real-time big data analytics. 
Storage Optimised  High, sequential read/write access to large datasets.  NoSQL databases, data warehousing, Hadoop. 
HPC Optimised  Optimised for the running of HPC workloads at scale.  Large, complex simulations and deep learning workloads. 
Accelerated Computing  Hardware accelerators for graphics and data processing.  Machine learning, gaming, video processing. 
Bare Metal  Direct access to hardware resources.  High-performance computing, specialised workloads. 

 

More detailed information on the instances available within each family can be found at AWS EC2 Instance Types. 

 

Choosing the Right EC2 Instance Size 

 

Choosing the right EC2 instance size is crucial for optimising performance and cost. Here are some key considerations to help you make the best choice: 

 

Understand Your Workload Requirements 

 

  • CPU: Determine the number of virtual CPUs (vCPUs) needed based on your application’s compute requirements. 
  • Memory: Assess the amount of RAM required for your application to run efficiently. 
  • Storage: Identify the type and size of storage needed (e.g., SSD for high I/O performance). 
  • Networking: Consider the network bandwidth requirements for data transfer. 

 

Analyse Performance Data 

  • CPU Utilisation: Instances with consistently low or high CPU usage may need resizing. 
  • Memory Utilisation: Instances with low memory usage might be overprovisioned. 
  • Network I/O: Evaluate the network traffic to ensure it matches your application’s needs. 

 

Choose the Right Instance Family 

 

Select an instance family that aligns with your workload: 

 

  • General Purpose: Balanced resources for a variety of applications (e.g., M5, T3). 
  • Compute Optimised: High-performance processors for compute-intensive tasks (e.g., C5). 
  • Memory Optimised: Large memory sizes for memory-intensive applications (e.g., R5). 
  • Storage Optimised: High I/O performance for storage-intensive applications (e.g., I3). 
  • Accelerated Computing: GPU instances for graphics and data processing (e.g., P3). 

 

Auto Scaling & Load Balancing 

 

One of the key benefits of cloud computing with AWS is the ability to flex and scale the services consumed to meet demand. Gone are the days of provisioning for peak usage from the start. AWS is designed to allow for scaling up or down for both planned and unexpected spikes and dips in load and usage. There are two key services that work with EC2 to allow for this: 

 

  • Auto Scaling with EC2 ensures that you have the right number of Amazon EC2 instances available to handle the load for your application. It automatically scales your EC2 instances up or down based on predefined conditions by adding and removing instances as needed. This ensures you are only paying for the instances you need when you need them. 

 

  • Elastic Load Balancing (ELB) works together with Auto Scaling by automatically distributing incoming application traffic across multiple targets, such as EC2 instances, containers, and IP addresses. It monitors the health of these targets and routes traffic only to the healthy ones. 

 

Working together, these services will ensure the availability and performance levels of your applications. Auto Scaling will add and remove instances as needed (including replacing failed instances) while ELB will continue to distribute traffic to all available instances. 

 

Cost Optimisation in AWS 

 

A key driver for organisations moving to AWS is to be able to run IT systems as cost-effectively as possible. AWS has many tools and services available to help with this. The rightsizing of compute services is the first step (such as choosing the right EC2 instance size), and services such as Auto Scaling and Elastic Load Balancing can also help. There are also ways to make commitments to compute service consumption at a reduced rate. 

 

The standard pricing model in AWS is referred to as On-Demand Pricing. This is the published cost of consumption for any service as shown on the AWS product pages and the Pricing Calculator by default. AWS provides discounts against this pricing for commitments of consumption for 1-year and 3-year periods with the use of Savings Plans and/or Reserved Instances. 

 

Amazon Web Services Savings Plans 

 

Savings Plans are available in two configurations: 

 

  • Compute Savings Plans provide the most flexibility and help to reduce your costs by up to 66%. These plans automatically apply to EC2 instance usage regardless of instance family, size, AZ, Region, OS, or tenancy, and also apply to Fargate or Lambda usage. For example, with Compute Savings Plans, you can change from C4 to M5 instances, shift a workload from EU (Ireland) to EU (London), or move a workload from EC2 to Fargate or Lambda at any time and automatically continue to pay the Savings Plans price. 

 

  • EC2 Instance Savings Plans provide the lowest prices, offering savings up to 72% in exchange for commitment to usage of individual instance families in a Region (e.g., M5 usage in N. Virginia). This automatically reduces your cost on the selected instance family in that region regardless of AZ, size, OS, or tenancy. EC2 Instance Savings Plans give you the flexibility to change your usage between instances within a family in that region. For example, you can move from c5.xlarge running Windows to c5.2xlarge running Linux and automatically benefit from the Savings Plan prices. 

 

Reserved Instances 

 

Reserved Instances are also available in two configurations: 

  • Standard Reserved Instances provide you with a significant discount (up to 72%) compared to On-Demand Instance pricing and can be purchased for a 1-year or 3-year term. Customers have the flexibility to change the Availability Zone, the instance size, and networking type of their Standard Reserved Instances. 

 

  • Convertible Reserved Instances provide some additional flexibility, such as the ability to use different instance families, operating systems, or tenancies over the Reserved Instance term. Convertible Reserved Instances provide you with a significant discount (up to 66%) compared to On-Demand Instances and can be purchased for a 1-year or 3-year term. 

 

AWS currently recommends Savings Plans over Reserved Instances due to their flexibility, but both are still available at this moment in time. Reserved Instances can provide higher savings than Savings Plans but are only really suitable for quite static deployments where future modernisations are not expected for the duration of the commitment. 

 

Telefónica Tech’s FinOps service add-on can help advise the most feasible cost optimisation options to meet your needs. 

 

Conclusion 

 

AWS offers a robust suite of compute services that cater to a wide range of business needs. By understanding the different EC2 instance types and leveraging tools like Auto Scaling and Elastic Load Balancing, businesses can optimise their cloud infrastructure for performance and cost. Additionally, AWS’s flexible pricing models, such as Savings Plans and Reserved Instances, provide significant opportunities for cost savings. 

 

Whether you’re just starting your cloud journey or looking to optimise your existing infrastructure, AWS provides the tools and services needed to succeed. Telefónica Tech UK is here to support you every step of the way, offering expert advice and solutions tailored to your specific needs. 

 

Ready to unlock the power of AWS compute services for your business? Contact Telefónica Tech UK today to schedule a consultation. Our team of talented AWS resources would love to have a conversation about the problems you are trying to solve and where the AWS Cloud could help you overcome them.