DEV Community

Cover image for A 0.99's Story⚡
ShatilKhan
ShatilKhan

Posted on

A 0.99's Story⚡

What's a o.99?

99% might seem like a great number for Server Availability but actually boils down to 7 hours of down time per month!
That's why the 9's after the dot are important.

Did you ever think about why or how Netflix Servers Never go down? or how Facebook Servers go down for hours sometimes?
This is caused due to Server Down time but we all know that mostly. We are going to talk about Server Up Time & the role of AWS Elastic Compute Cloud service, how it works & it's role in reducing server down times , how it instantly scales up to handle high amounts of users.
And for the previous question, Netflix Operates at an Availability rate of 99.99% !

What & Why of EC2

Social Media Applications like Facebook, Tiktok or Instagram get more than 50 Million Users Every Month. But they aren't handling 50 Million users Every Single Moment. Sometimes it could spike up to more than 100 Million Users! This could instantly increase your Cloud Computing Costs a Hundred Folds. So How do you handle this instant spike? specially during Holiday seasons when everyone's on their phones sharing Terabytes of data online.
You balance things up to reduce cost.

Image description

AWS EC2 makes it so that you no longer need to use or buy new servers when there's a user spike up, instead it automatically scales up the software to meet the needs. It also stay in high availability because of the world wide AWS availability regions. So even if one region is damaged , backups from another region will instantly ring up & pull the entire system online.

Image description

You can also pick & choose the type of EC2 instances you wish to use. For example if you're hosting hardware heavy application that needs extensive GPU power you can adjust & create an EC2 instance that uses more GPU power. Or in case of analyzing large amounts of data you allocate more storage to your instance. This way you no longer have to worry about configuring your software manually & use EC2 to serve any purpose.

Now let's see how you can easily ring up an EC2 instance of your own.

Creating an EC2 Instance

  • Go to AWS Console & in the search bar look for EC2

Image description
Select the EC2 service

  • On the side panel , click on instances

Image description

  • Check the AWS Computing Service Instance & review the details

Image description

  • After that click on Instance Types on the left panel
  • Search & select these 3 instance types t3.large c5.large r5.large & check them all

Image description

  • Return to instances tab & copy the IPV4 address

Image description

  • Paste the id in a new browser tab & you should see something similar with all the info from your instance.

Image description

  • Back to instances tab , click on connect

Image description

  • You can click & review each individual section then click connect

Image description

  • You will be taken to a Terminal environment, now you must carry out these code commands:
  1. Type the following command to provide ROOT Privilege:

sudo -i

  1. To change to the application directory, run:

cd ../home/ec2-user/sample_app

  1. To view the files in the sample_app directory, run:

ls

  1. To check the instance log, run:

tail -lf aws_compute_solutions.log

Image description

Make sure to add proper space & '.' / '_' in each command , as you can see I got an error for writing 'sample.app' instead of 'sample_app'

  • Review the log details, press Cntrl + C , close the terminal window & return to your instance tab.

Image description

  • In your instances tab, go to Actions > Instance Settings > Edit User Data

Image description

  • Review the commands under current user data

Image description

-Return to Instances tab, click on Instance State > Stop Instance, when prompted , click 'stop'

Image description

That's pretty much it!
The complete bare bone basics of running an AWS EC2 instance. You can restart your instance by going on Instance State > Start
Review more info on the Instance Action tab.
This demo was done to show a basic idea of EC2 & how to navigate around an EC2 instance.
You can do this exercise by going to AWS Cloud Quest

Happy Coding!

Image description

Top comments (0)