Amazon Web Services(AWS):Tutorial 3



Welcome to the Third Tutorial of this AWS Series.

Following are the topics we will cover today:-
  • EC2 Pricing
  • AMI
  • Final bits about EC2 Instances

EC2 Pricing

  • EC2 prices(hourly price) may vary depending on the following factors:-
    • AWS region you are in.
    • AWS Instance(check out tutorial 2 for this) type you are using.
    • On-Demand vs Spot vs Reserved vs Dedicated Host
    • The kind of Operating System you are using, Linux or Windows or any other OS.
    • You also have to pay based on the usage of other resources such as storage, data transfer, fixed IP public addresses, load balancing
  • Billing happens at a granularity of 60 seconds.
  • You stopped getting billed as soon as the instance is stopped.
  •  The best way to learn all the details about the Pricing Scheme is to check out this Pricing Page of AWS.

AMI

  • AWS comes with basic version/image of various Operating Systems such as Ubuntu, RedHat, Windows etc. These images can be customized at runtime using EC2 User data. Using these images, EC2 instances are created.
  • AMI is our custom OS image which we can use to create our instances. AMIs can be built for Linux or Windows machines.
  • Following are the advantages of using a custom built AMI:-
    • You can pre-install the packages that you'll be needing.
    • Boot time is less as there is no longer need to wait for EC2 User Data Boot Time.
    • You will have the control over the maintenance and updates of AMI over time.
    • You can optimize your AMI for running a particular App, Database etc.
  • NOTE:- AMI is built for a specific AWS Region.

Final bits about EC2 instances

  • A EC2 Instance have 5 different characteristics and you can choose from among different configurations of these. These characteristics are:-
    • RAM (type, amount, generation)
    • CPU (type, frequency, generation, number of cores)
    • I/O (disk performance)
    • Network (network bandwidth, network latency)
    • Graphical Processing Unit (GPU)
  • You can choose from among 50 Instance types on AWS's site:- https://aws.amazon.com/ec2/instance-types/  and https://ec2instances.info/ site will help with summarizing various types of instances.
  • AWS has a concept of something known as Burstable Instances(T2). What this means is, during normal operation of there instances, the CPU performance will be OK. But when the machine needs to process an unexpectedly high load, it can Burst and CPU performance will become VERY GOOD.
  • When a machine is in BURST mode, it utilizes something known as "burst credits". If all your "burst credit" is over your CPU will perform BAD. The "burst credits" get accumulated over time after your machine stops bursting.
  • Burstable Instances are amazing to handle cases of unexpectedly high traffic and provide assurance of handling it correctly. But if your CPU is running on low burst credit for long, it means that you have heavy traffic on your site and you should move to a Non-Burstable Instance.
  • There is also a provision for an "unlimited burst credit balance". In this case, you pay extra money if you go over your credit balance, but you don’t lose in CPU Performance.

Finally I would say that first and foremost you learn the below points when you start using EC2:-

  1. Learn how to SSH into EC2 and change .pem file for permissions.
  2. Learn how to properly use security groups.
  3. Learn the fundamental differences between private vs public vs elastic IP.
  4. Learn how to use User Data to customize your instance at boot time.
  5. Learn to build custom AMI to enhance your OS.



Comments