Amazon EC2 instance
Tags: amazon, aws, ec2, serverless
Published: 2022-07-17 10:34:39

## What is an Amazon EC2 instance?

Amazon EC2 is a virtual server in Amazon's Elastic Compute Cloud (EC2), which is used to run applications on the Amazon Web Services (AWS) infrastructure. AWS is a comprehensive, evolving cloud computing platform; EC2 enables business subscribers to run applications in the computing environment. As a virtual machine (VM), it can serve an almost limitless number of purposes.

Amazon provides various types of instances with different configurations of CPU, memory, storage, and networking resources. Each type is available in different sizes to meet specific workload requirements.

Instances are created using Amazon Machine Images (AMI). Machine images are like templates. An operating system (OS) and other software determine the user's operating environment. The AMI can be selected from AWS, the user community, or through the AWS Marketplace. Users can also create their own AMIs and share them.

## Types of EC2 instances

are divided into families based on target application profiles. Examples include:

**All-purpose**
A general purpose instance is a VM that is designed to handle a wide variety of workloads. A general purpose instance is optimized to have a high number of CPU cores, on-demand storage, and memory. General purpose instances are typically used for web server hosting and software development and testing.

**Compute-optimized**
On AWS, compute-optimized instances are used to run big data applications that require a great deal of processing power and memory. Dedicated instances are designed to run computational and data-intensive applications that require fast network performance, extensive availability, and high input/output operations per second (IOPS). Some examples of types of applications include scientific and financial modeling and simulation, machine learning, enterprise data warehousing, and business intelligence.

**Graphics processing unit (GPU)**
Graphics-intensive applications can run faster on these instances than on standard EC2 instances. Games and design applications rely on GPUs. Linux distributions, for instance, often use GPUs for rendering graphical user interfaces, improving compression rates and speeding up database queries.

**Memory-optimized**
A memory-optimized instance uses a high-speed, solid-state drive to deliver high performance and ultra-fast data access. They are ideal for applications requiring more memory and less CPU power, such as open source databases, real-time big data analytics, and in-memory caches.

**Storage optimized**
A storage optimized instance is ideal for applications that require high I/O performance, such as NoSQL databases that store and retrieve data in real time. Furthermore, they are well suited for memory-intensive applications, such as data processing, data warehousing, analytics workloads, and log processing.

**Micro**
instances are intended for applications with low throughput. A micro instance can serve as a small database server, a platform for software testing, or a web server that doesn't require high transaction rates.


## Amazon EC2 instance features
Many EC2 instance characteristics can be customized, including storage, the number of virtual processors and memory available to the instance, OS, and the AMI on which the instance is based. Below is a list of Amazon EC2 instance features:

**Operating system**
Linux, Microsoft Windows Server, CentOS, and Debian are supported by EC2.

**Persistent storage**
Amazon's Elastic Block Storage (EBS) service allows you to attach block-level storage volumes to EC2 instances and use them as hard drives. With EBS, you can increase or decrease the amount of storage available to an EC2 instance and attach EBS volumes to more than one instance at the same time.

**Elastic IP addresses**
With Amazon's Elastic IP service, IP addresses can be associated with an instance. It is possible to move elastic IP addresses from instance to instance without the assistance of a network administrator. These features make them ideal for use in failover clusters, load balancing, and other applications that require multiple servers running the same service.

**Amazon CloudWatch**
Monitoring of AWS cloud services and applications deployed on AWS is made possible through this web service. CloudWatch collects, stores and analyzes historical and real-time performance data. Additionally, it can proactively monitor applications, improve resource usage, optimize costs, and scale up or down based on changing workloads.

**Automated scaling**
In response to application demand, Amazon EC2 Auto Scaling automatically adds or removes capacity from virtual servers. By using auto scaling, you can accommodate temporary spikes in traffic during a product launch or adjust capacity based on whether use exceeds or falls below certain thresholds.

**Bare-metal instances**
The virtual server instances consist of hardware resources, such as a processor, storage, and network. They are not virtualized and do not run an operating system, so they consume less memory, are more secure, and are faster.

**Amazon EC2 Fleet**
Using this service, instances can be deployed and managed as a single virtual server. With the Fleet service, you can launch, stop, and terminate EC2 instances across all EC2 instance types in one go. EC2 Fleet also offers programmatic access to fleet operations via an API. The system can be integrated into existing management systems. EC2 Fleet allows policies to be scaled to automatically adjust fleet size based on workload.

**Pause and resume instances**
Instances can be paused and resumed from the same state later. As an example, if an application consumes too many resources, it can be paused without incurring charges.