AWS Compute  Service - EC2 (Elastic Cloud Compute)

AWS Compute Service - EC2 (Elastic Cloud Compute)

In this Article we are going to learn about EC2 that is compute Service.

Agenda :

  1. What is EC2 ?

  2. Why EC2?

  3. Types of EC2 ?

  4. Regions and Available Zones

Now let's get started with the Question

What is an EC2 ?

Basically it's an Elastic cloud compute service on AWS . Usually when you're requesting to the AWS for the virtual server which includes CPU, RAM , DISK etc. So , AWS has lots of servers in different regions and it creates the virtual server with hypervisor on that region where you want to work and easily you'll work there and pay for it.

Why AWS use prefix Elastic for some set of services ?

AWS use prefix Elastic for some set of services like EC2 , EKS , EBS, ECR etc. which basically means that these services can be scale up and scale down on the need of the user as like the concept of elasticity.

Now let's understand why it's so called name EC2.

EC2 means that the user is asking to cloud for the virtual server that is compute service which should be elastic in nature. In short we used to say it EC2.

Now the question arises why should i use EC2?

There are two major reason to use the EC2 is that

  • Maintenance

  • Cost

Suppose you're a system administrator or DevOps engineer and you're buying the actual server from IBM or somewhere and on the top of that you're creating a Virtual server with the help of the hypervisor. But if you get 1000 of request from the Developers and you'll create then after you've to take care of timely upgradation, security issue, server downtime and many issue so far and it will be so hectic for them and also it's a waste of whole day.

Instead of suffering with this we can use EC2 from any region and modify it accordingly and after use we can shutdown the server and the best part is that we have to pay only for that on going server time.

Now there are some types of Elastic Cloud Compute service i.e. EC2

There are some features of EC2

  • General Purpose

  • Compute optimized

  • Memory Optimized

  • Accelerated Optimized

  • Storage optimized

  • HPC optimized

General Purpose :

General purpose instances provide a balance of compute, memory and networking resources, and can be used for a variety of diverse workloads. These instances are ideal for applications that use these resources in equal proportions such as web servers and code repositories. .

generally, we are using only general purpose to do projects and all the stuff.

Compute optimized :

Compute Optimized instances are ideal for compute bound applications that benefit from high performance processors. Instances belonging to this category are well suited for batch processing workloads, media transcoding, high performance web servers, high performance computing (HPC), scientific modeling, dedicated gaming servers

It uses for video encoding, gaming, scientific modelling, distributed analytics, and CPU-based machine learning inference.

Memory Optimized :

Memory optimized instances are designed to deliver fast performance for workloads that process large data sets in memory.

It uses for Memory-intensive workloads such as open source databases, in-memory caches, and real-time big data analytics.

Accelerated Optimized :

Accelerated computing instances use hardware accelerators, or co-processors, to perform functions, such as floating point number calculations, graphics processing, or data pattern matching, more efficiently than is possible in software running on CPUs.

It uses for Generative AI applications, including question answering, code generation, video and image generation, speech recognition, and more.

HPC applications at scale in pharmaceutical discovery, seismic analysis, weather forecasting, and financial modeling.

Storage optimized :

Storage optimized instances are designed for workloads that require high, sequential read and write access to very large data sets on local storage. They are optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications.

It uses for real-time analytics such as Apache Spark.

HPC optimized :

High performance computing (HPC) instances are purpose built to offer the best price performance for running HPC workloads at scale on AWS. HPC instances are ideal for applications that benefit from high-performance processors such as large, complex simulations and deep learning workloads.

Now let's move on to the practical part we are going to create an EC2 instance .

This is an AWS console home page.

Now click on the EC2

  1. Click on the Launch Instance

  2. AWS provides lots of AWS OS(operating System ) like Ubuntu, Centos, Red hat, Mac OS etc. choose OS accordingly on which you want to work.

  3. AWS usually provides some free tier condition that you can use 750 hours for a month which will be of t2.micro and key pair are usually used for the connecting to the terminal with server like Ec2 server to Mac terminal

  4. Now click on the create new key pair and fill out details if you are using putty them go for .ppk and create new key pair.

  5. Now click on the launch instance . We'll understand about the firewall security groups and all stuff in later articles.

  6. Now it processing

  7. Now your instances is running and click on instance id. Finally you've successfully created and EC2 instance.

  8. Now you can see that there is an instance id and public ipv4 address which we can use to access anything on the web. Next click on the connect option.

  9. Now with the ssh client copy the details e.g. ssh -i "My_linux_key.pem" ec2-user@ec2-34-229-122-236.compute-1.amazonaws.comc2-user@ec2-34-229-122-236.compute-1.amazonaws.com and paste on your local terminal but mind it go on that folder where you've downloaded key pair and give that file to full access and paste it and run it.

  10. The best practice is that after connecting the terminal update it. And after completing your work shutdown the Instance otherwise it will charge you.

Conclusion

Now in this blog you've learn about the AWS EC2 service it's importance and it's types and hope so you've successfully created an EC2 instance.

In the Upcoming Blog I'm going to cover about the AWS VPC so be consistent and if you haven't read the previous articles then please read it will help to uplift yourself.

Hope so you'll like it do follow share with all #aws learner and Keep on practicing and if you've any doubt them drop in a comment section.

Happy learning :)