Introduction to EC2


Published on

General high level overview of Amazon EC2, reviewing pricing

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Introduction to EC2

  1. 1. Introduction to ec2<br />Mark Squires II – RAMP51<br />Charlotte ALT.NET<br />Target Audience: Senior Developers/Architects<br />
  2. 2. Amazon Web Services<br />Provider of scalable infrastructure services<br />Core Cloud Services<br />Elastic Compute Cloud (EC2)<br />Push/Pull Messaging (SQS/SNS)<br />Simple Data Service (SDB) <br />Durable Storage (S3)<br />
  3. 3. My Favorite Thing About AWS<br />What I love most about AWS is it’s the only service I pay for monthly that routinely sends me emails with good news.<br />Its always one of two possible emails<br />We have lowered our prices<br />We have added features<br />
  4. 4. Not in this powerpoint<br />Information about non EC2 services<br />Security groups<br />Snapshots,or AMI’s<br />However, we can talk about some of these things. I just wanted to prevent a 200 slide deck.<br />
  5. 5. AWS Platform Overview<br />Courtesy of Mike Culver at AWS. (Approved Usage By AWS)<br />This is actually outdated, as there is a 5th region now in Japan<br />
  6. 6. What is EC2?<br />Primarily Ec2 is the service that will provide you with a virtual instance that you can remote into (RDP/SSH)<br />Create an instance<br />Create a machine image<br />Create a load balancer<br />Create snap shots of your disks<br />Create static ip address<br />Ability to swap drives and ip addresses between instances<br />Ability to use SSL Termination at the load balancer<br />Ability to define intricate security groups and firewall rules between security groups and for external CIDR blocks<br />Ability to monitor instances and create alerts<br />Ability to load balance across multiple physical data centers<br />Ec2 does some other things too that are out of the scope of this presentation.<br />
  7. 7. Components of EC2<br />Elastic Block Store (EBS) – storage<br />EBS Snapshotting<br />Amazon CloudWatch – monitoring<br />Amazon Machine Images<br />Auto Scaling – horizontal scaling<br />Elastic Load Balancing<br />Virtual Private Cloud – vpn bridge<br />Elastic IP Address<br />High Performance Compute Clusters<br />VMWare Image Import<br />
  8. 8. Designed Expecting to Fail<br />The cloud is NOT designed to prevent failure, but to anticipate failure<br />While nearly any application can be deployed to EC2 the best applications for EC2 have already been designed expecting failures<br />
  9. 9. Non-Committal<br />No long term commitments required<br />Free to play the field<br />Mix and Match cloud services and cloud providers<br />
  10. 10. What you get?<br />The price of an instance is based on attributes of the type of instance you created.<br />Windows costs more than Linux. (Amazon kindly includes the cost of your windows license in the price)<br />More memory, more CPU drive up the hourly cost<br />
  11. 11. What’s included?<br />When you buy an instance you are renting:<br />A fixed allotment of CPU measured in Elastic Compute Units (ECUs)<br />A fixed allotment of Memory (RAM)<br />Some instance types offer a fixed allotment of temporary ephemeral storage<br />
  12. 12. Instance Type Classes<br />Micro<br />t1.micro(*up to 2 ECU)<br />Standard<br />m1.small(1 ECU)<br />m1.large(2 ECU * 2 core)<br />m1.xlarge(2 ECU * 4 core)<br />High Memory<br />m2.xlarge(3.25 ECU * 2 core)<br />m2.2xlarge(3.25 ECU * 4 core)<br />m2.4xlarge(3.25 ECU * 8 core)<br /><ul><li>High Compute
  13. 13. c1.medium
  14. 14. c1.xlarge
  15. 15. Cluster Compute
  16. 16. cc1.4xlarge
  17. 17. Cluster GPU
  18. 18. cg1.4xlarge</li></ul>*t1.micro is burstable, you share<br /> the CPU with others and get any <br />unused cpu Cycles when needed<br />Nodes in yellow are 32-bit, other are 64-bit<br />
  19. 19. Geez. What does it cost?<br />There is a sea of pricing options making it very flexible.<br />You can get very creative in how you manage these costs.<br />There are three major pricing schemes for an EC2 instance.<br />On-Demand Pricing<br />Reserved Pricing<br />Spot Pricing<br />
  20. 20. It’s Priced Hourly<br />These prices are only for one particular instance size, the T1.MICRO which is the smallest & cheapest instance type<br />The pricing plans are not only different in pricing, but also have differences in instance availability<br />
  21. 21. An Instance Hour<br />Each hour or partial hour you are using any EC2 Instance counts as an “Instance Hour” you are billed by the instance hour<br />
  22. 22. On Demand Pricing<br />Request an instance on demand and use it until you are done with it<br />More expensive than other pricing options from an hourly perspective<br />Contingent on Capacity, if AWS has no available capacity for the instance type in the availability zone that you requested, you will get an “out of capacity” error.<br />
  23. 23. Reserved Pricing Plan<br />Requires a 1 year or 3 year commitment and a corresponding commitment fee<br />Can’t be used on SQL Server Standard instances<br />Usually saves ~30-55% for instances that are run continually (24x7)<br />Guarantees you that an instance for your reservation type in the AZ of your reservation will always be available upon your request<br />
  24. 24. UnderstandingReserved Pricing<br />Reserved Pricing Doesn’t buy you another instance<br />Assume you use a Linux t1.micro instance 24x7 for an entire year ON-DEMAND. You are paying for 24*365=8760 instance hours @ $0.02<br />$175.20 per year<br />If you buy a “1 Year Reservation” for a Linux t1.micro instance, you have simply bought the right to pay $0.007 per hour for ~8760 instance hours during the next year instead of $0.02 per hour.<br />It doesn’t apply to any particular ec2 instance, it’s more of a billing discount, the 1 year reservation you just purchased will be automatically apply to one of your existing instances that match the reservation criteria<br />It does however guarantee that at least one type of this instance will be available for your use whenever you need it<br />
  25. 25. Spot Pricing<br />How Amazon monetizes all it’s available resources<br />Works like the stock market<br />More Demand = Higher Price<br />Bid based model, people who Bid more will steal resources from the person with the lowest bid<br />Should only be used to host applications that have tolerance for being randomly shut down without notice<br />Usually the cheapest pricing, but not always<br />
  26. 26. ASP.NET on EC2<br />Easily load balance your ASP.NET app using an EC2 Elastic Load Balancer<br />SQL Server can be costly unless your application can run on SQL Server Express<br />RAMP51 is currently running multiple websites using<br />1 – ELB (to allow easy horizontal scaling)<br />1 - t1.micro <br />1 - m1.small (hosting SQL express)<br />1 – db.m1.small MySQL RDS Instance<br />1 – Simple DB Database<br />
  27. 27. Creative Cost Savings<br />Horizontal scaling up of application tiers during peak hours and down during slow hours, reducing instance hours to be paid for; via Auto Scaling groups or Spot Instance Tier Blooming (I made this term up I think)<br />Spot Instance Tier Blooming<br />Blooming your web tier with extra instance based on spot pricing, for example (add as many t1.micro instances to my web tier as I can get for $0.10/hr during the hours of 9am est – 5pm est<br />Not sure any applications exist yet that will do this but its an idea I’ve been pondering <br />
  28. 28. More Cost Savings<br />Using MySql via Amazon RDS<br />Using SimpleDB Service<br />Using a SQL Azure instance from your EC2 Instance (haven’t tested latency of this)<br />Moving web assets onto S3/CloudFront reducing bandwidth costs and load on instances<br />
  29. 29. Instance Management<br />All instances have basicCloudWatch monitoring which monitors IO, CPU, Memory<br />Detailed monitoring is available which monitors at a higher interval than basic<br />AWS is driven by a powerful set of APIs so you either need to write code or use a tool to manage your AWS resources<br />
  30. 30. Major Tools Available<br />ElasticFox – Firefox plugin, which I happen to prefer for most tasks<br />Open source, but it appears Amazon stopped updating it mid 2010<br />There is probably some space for another open source version aside from elastic fox<br />Amazon Web Console – supports a lot of management functions<br />Does more than elasticfox<br />Useful for many services not just EC2<br />Command Line Tools available for all services. The command line tools are usually the first to support new features.<br />
  31. 31. Auto Scaling<br />EC2 offers the ability for you to automatically scale a group of services up and down based on a metric<br />For example, you have an auto-scaling group that has 2 instances serving web requests<br />You could define an auto-scaling rule such as: if the avg. CPU usage exceed 85% for longer than 5 minutes add 2 more instances, and when the avg. CPU drops below 50% for more than 20 minutes shut down two instances<br />There are a wide variety of configurations you can create that can leverage a number of metrics<br />
  32. 32. Demonstration<br />Auto-Scaling an ASP.NET App that writes to Simple DB for shared data access<br /><br />
  33. 33. Setting up CMD Tools<br />IAM Tools<br /><br />EC2 Tools<br /><br />ELB Tools<br /><br />
  34. 34. Useful Links<br />EC2 Overview<br /><br />EC2 Pricing<br /><br />AWS Blog<br /><br />AWS SDK for .NET<br /><br />
  35. 35. Contact Info<br />Mark Squires<br /><br />Blog<br /><br />