65
向向向向向向向向向 Amazon Web Services Hank Lin

Learn from AWS 2

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Learn from AWS 2

向成功的雲服務學習Amazon Web Services

Hank Lin

Page 2: Learn from AWS 2

Hank Lin

@hanklinhttp://hanklin.com/[email protected]

Page 3: Learn from AWS 2

My AWS Book ;)

• ISBN: 9789861992792

Page 4: Learn from AWS 2

Topics

Amazon如何滿足網路 startup

Amazon與其它廠的競合關係

Page 5: Learn from AWS 2

You Call This Cloud?

http://www.flickr.com/photos/lennysan/4403695791/

Page 6: Learn from AWS 2

I Say This Is Cloud

Photo by Pierre J. (French Army, July 3, 1970)

Page 7: Learn from AWS 2

Everything Is a Service

Software as a ServicePlatform as a ServiceInfrastructure as a Service * as a Service

Page 8: Learn from AWS 2

Nothing New

http://en.wikipedia.org/wiki/File:The_Earth_seen_from_Apollo_17.jpg

Page 9: Learn from AWS 2

Nothing New

InternetVirtualization, VPSPlatformASPBrowser, RIANoSQLScaling Out/Up

Page 10: Learn from AWS 2

Everything Changes

http://en.wikipedia.org/wiki/File:Giantimpact.gif

Page 11: Learn from AWS 2

Everything Changes

APIsOn-DemandPay As You GoInfinite CapacityLease Instead Of ProvisionReallocate Instead Of RecoverScaling In/Down

Page 12: Learn from AWS 2
Page 13: Learn from AWS 2

Customer-centric

Agile Development2 weeks ~ 1 month iterationWhat customers want

Page 14: Learn from AWS 2

Developer-centric

Eat your own dog foodAPIsAsync. & BatchingStart from simple

Page 15: Learn from AWS 2

Guns, Lots of Guns

(a picture was here)

Page 16: Learn from AWS 2

AWS Products

http://www.flickr.com/photos/dunechaser/4785103816/

Page 17: Learn from AWS 2

AWS ProductsFunction Products

Compute EC2、 EMR、 Auto Scaling

Storage S3、 EBS、 AWS Import/Export、 Public Dataset

Database SimpleDB、 RDS

Messaging SNS、 SQS、 SES

CDN CloudFront

Networking Route 53、 VPC、 ELB

Monitoring CloudWatch

Deployment Elastic Beanstalk、 CloudFormation

Payments FPS、 DevPay

Support Premium Support

E-Commerce FWS、 Mechanical Turk

Web Traffic Alexa Top Sites、 Alexa Web Information Service

Page 18: Learn from AWS 2

EC2

http://opencompute.org/

Page 19: Learn from AWS 2

Template (AMI)

Large Instance

High-CPU Extra Large Instance

High-Memory Double Extra Large Instance

Launch different instance types

Page 20: Learn from AWS 2

32-bitType CPU RAM Storage Arch. IO Name

Small 1 ECU 1.7 GB 150 GB 32-bit Moderate m1.small

Micro Max 2 ECUs

613 MB EBS only 32-bit or 64-bit

Low t1.micro

High-CPU Medium

5 ECUs 1.7 GB 340 GB 32-bit Moderate c1.medium

*EC2 Compute Unit (ECU) – equivalent of a 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor.

Page 21: Learn from AWS 2

64-bitType CPU RAM Storage Arch. IO Name

Large 4 ECUs 7.5 GB 840 GB 64-bit High m1.large

Extra Large 8 ECUs 15 GB 1680 GB 64-bit High m1.xlarge

High-CPU Extra Large

20 ECUs 7 GB 1680 GB 64-bit High c1.xlarge

High-Memory Extra Large

6.5 ECUs 17.1 GB 420 GB 64-bit Moderate m2.xlarge

High-Memory Double Extra Large

13 ECUs 34.2 GB 840 GB 64-bit High m2.2xlarge

High-Memory Quadruple Extra Large

26 ECUs 68.4 GB 1680 GB 64-bit High m2.4xlarge

Page 22: Learn from AWS 2

High Performance ComputingType Processor RAM Storage Arch

.IO Name

Cluster Compute Quadruple Extra Large

33.5 ECUs(2 Intel Xeon X5570, quad-core Nehalem)

23 GB 1680 GB 64-bit Very high (10 Gbps Ethernet)

cc1.4xlarge

Cluster GPU Quadruple Extra Large 

33.5 ECUs (2 Intel Xeon X5570, quad-core Nehalem), 2 NVIDIA Tesla M2050 Fermi GPUs

22 +1 GB2 x 3 GB (on GPU ECC)

1680 GB 64-bit Very high (10 Gbps Ethernet)

cg1.4xlarge

*Tesla Fermi M2050 contains 448 cores and 3 GB of ECC RAM and are designed to deliver up to 515 gigaflops

Page 23: Learn from AWS 2

NASA JPL

Processing 3.2 Giga-pixel Images In 2 Hours, 30 Instances. Improved an order of magnitude.

20 Gigaflops -> 1.3 Teraflops

MATLAB team at MathWorks

Page 24: Learn from AWS 2

Regions & Availability Zones

Page 25: Learn from AWS 2

就算殺了一個我,還有千千萬萬個我(a picture was here)

Page 26: Learn from AWS 2

(a picture of Agent Smiths was here)

Page 27: Learn from AWS 2

Pricing

TypeRegionOSOn-Demand/Reserved/Spot/TenancyPaid AMIInstance-hoursEBS volumes/snapshots

Page 28: Learn from AWS 2

Elasticity & Agility

EBSEIPVPCEMRELBAuto ScalingCloudWatchBeanstalk

Page 29: Learn from AWS 2

EC2 Customers

ZyngaPlayfishRedditMyspaceNetflixJustin.tvAnimotoHeroku

Page 30: Learn from AWS 2

break;

Page 31: Learn from AWS 2

EC2

Page 32: Learn from AWS 2
Page 33: Learn from AWS 2

Attach

EBS volume

Instance

EBS volume

Instance

EBS snapshot in Amazon S3

Create snapshot

Page 34: Learn from AWS 2

EBS volume

Instance A

EBS snapshot in Amazon S3

Detach

Instance B

Same EBS volume

Attach

Create volume

Instance C

New EBS volume

Attach

Page 35: Learn from AWS 2

Web Servers

App Servers

DB Servers

Authorize access from app server group

Authorize access from DB server group

Amazon EC2 Security Group Firewall

Open 80,443 to internet

Open 22 to corporate network

Open 22 to corporate network

All other traffic denied

Page 36: Learn from AWS 2

S3

Save a picture OK

Save a DVD disc OK

Save a Bluray disc OK

Page 37: Learn from AWS 2
Page 38: Learn from AWS 2
Page 39: Learn from AWS 2
Page 40: Learn from AWS 2
Page 41: Learn from AWS 2
Page 42: Learn from AWS 2
Page 43: Learn from AWS 2

PricingStorage us-east, eu-west, ap-se us-west ap-ne

Standard RRS Standard RRS Standard RRS

First 1 TB $0.140 $0.093 $0.154 $0.103 $0.150 $0.100

1~ 50 TB $0.125 $0.083 $0.139 $0.093 $0.135 $0.090

50 ~ 500 TB

$0.110 $0.073 $0.124 $0.083 $0.120 $0.080

500 ~ 1000 TB

$0.095 $0.063 $0.109 $0.073 $0.105 $0.070

1000 ~ 5000 TB

$0.080 $0.053 $0.095 $0.063 $0.090 $0.060

5000+ TB $0.055 $0.037 $0.070 $0.047 $0.065 $0.044

* Prices are calculated per GB** Requests and Bandwidth also incur charges

Page 44: Learn from AWS 2

Simple & Reliable

Buckets & ObjectsCapacity : ∞High Scalability, Availability, DurabilityREST/SOAP/BTACL/metadata/RRSEncryptionIntegrate with other AWS services

Page 45: Learn from AWS 2

S3 Customers

AmazonDropboxTwitterSmugmugYelpUbuntu OneZmandaTumblr

Page 46: Learn from AWS 2

Distinction

Amazon.com’s ExperiencesReal Developers’ NeedsFull IaaS ProductsEnormous Developer Tools/Libraries

Page 47: Learn from AWS 2
Page 48: Learn from AWS 2

AWS Ecosystem

End UsersWeb Sites/StartupsISVsSystem Integrators

Page 49: Learn from AWS 2

人人有功練(a picture was here)

Page 50: Learn from AWS 2

OS

Red Hat Enterprise LinuxSUSE Linux EnterpriseFedoraWindows ServerAmazon Linux AMIGentoo LinuxOracle Enterprise LinuxUbuntu LinuxDebian

Page 51: Learn from AWS 2

IBM DB2IBM Informix Dynamic ServerIBM Lotus Web Content ManagementIBM WebSphere Portal ServerIBM WebSphere Application ServerIBM sMash

Page 52: Learn from AWS 2

Microsoft SQL Server StandardMicrosoft IIS/ASP.NETWindows Media ServerMySQL EnterpriseOracle Database 11gJboss Enterprise Application PlatformWowza Media Server ProSmartFoxStackIQ Rocks+

Page 53: Learn from AWS 2

Demo

Page 54: Learn from AWS 2

Alestic AMIs

Page 55: Learn from AWS 2

EC2 Instance Initializationmbp:~ hank$ ec2-run-instances ami-7c423c2e -k sg-web -t m1.small -g www -z ap-southeast-1a...... i-fd1fd5a8 ami-7c423c2e pending sg-web 0......

mbp:~ hank$ ec2-describe-instances i-fd1fd5a8...... i-fd1fd5a8 ami-7c423c2e ec2-122-248-220-243.ap-southeast-1.compute.amazonaws.com ......

mbp:~ hank$ ssh -i sg-web.pem [email protected]

[ubuntu@ip-10-130-93-73 ~]$ sudo apt-get -y update && apt-get -y install apache2 php5 php5-curl

Page 56: Learn from AWS 2

EC2 Instance Initializationmbp:~ hank$ ec2-run-instances ami-7c423c2e -k sg-web -t m1.small -g www -z ap-southeast-1a...... i-fd1fd5a8 ami-7c423c2e pending sg-web 0......

mbp:~ hank$ ec2-describe-instances i-fd1fd5a8...... i-fd1fd5a8 ami-7c423c2e ec2-122-248-220-243.ap-southeast-1.compute.amazonaws.com ......

mbp:~ hank$ ssh -i sg-web.pem [email protected]

[ubuntu@ip-10-130-93-73 ~]$ sudo apt-get -y update && apt-get -y install apache2 php5 php5-curl

LAME! I Want Automatic Initialization

Page 57: Learn from AWS 2

EC2 Instance Initialization#!/usr/bin/env bashset -exsudo apt-get -y updatesudo apt-get -y install apache2 php5 php5-curl# install AWS SDK# install application code# get public-ipv4 from EC2 instance metadatapublic_ipv4 = $(wget -qO- 169.254.169.254/latest/meta-data/public-ipv4)# do something useful with $public_ipv4# more initializations ...

"init-web.sh"

Page 58: Learn from AWS 2

EC2 Instance Initializationmbp:~ hank$ ec2-run-instances ami-7c423c2e -k sg-web -t m1.small -g www -z ap-southeast-1a -f init-web.sh...... i-c10fc594 ami-7c423c2e pending sg-web 0......

mbp:~ hank$ ec2-describe-instances i-c10fc594...... i-c10fc594 ami-7c423c2e ec2-122-248-221-187.ap-southeast-1.compute.amazonaws.com ......

mbp:~ hank$ curl 122.248.221.187<!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>My Killer App</title>......

Page 59: Learn from AWS 2

I Need More Computing Power, And I Need It NOW

mbp:~ hank$ ec2-run-instances ami-12423c40 -k sg-web -t c1.xlarge -g www -z ap-southeast-1a -f init-web.sh -n 10

...... i-320c424e ami-12423c40 pending sg-web 0............ i-5a2c2519 ami-12423c40 pending sg-web 1......

Page 60: Learn from AWS 2

More Work

Scheduled Back UpMonitor And AlertNotify LB, Controller, etcFailoverMulti-AZ, Multi-RegionAutomatically Scale In/OutCeil, Floor, Cool down

Page 61: Learn from AWS 2

AWS Judgment Day

Page 62: Learn from AWS 2

When The Sky Is Falling

Page 63: Learn from AWS 2

AWS Free Usage TierProduct Quota (for new users, expired in 1 year)

EC2 750 instance-hours. (t1.micro, Linux)

EBS 10GB , 1M I/Os. (snapshot: 10GB , 10K GETs, 1K PUTs)

ELB 750 LoadBalancer-hours, 15GB data processing

S3 5GB standard storage, 20K GETs, 2K PUTs

Network 15GB in and 15GB out. (except CloudFront)

Product Quota (for new users, expired in 1 year)

EC2 750 instance-hours. (t1.micro, Linux)

EBS 10GB , 1M I/Os. (snapshot: 10GB , 10K GETs, 1K PUTs)

ELB 750 LoadBalancer-hours, 15GB data processing

S3 5GB standard storage, 20K GETs, 2K PUTs

Network 15GB in and 15GB out. (except CloudFront)

* Quota are calculated per month

Page 64: Learn from AWS 2

If I have seen further it is by standing on the shoulders of giants

http://en.wikipedia.org/wiki/File:Orion_aveugle_cherchant_le_soleil.jpg

Page 65: Learn from AWS 2

Thank you

(a picture was here)