Cloud Computing in Practice

57
Cloud Computing in Practice King Chung Huang Technical Solutions Analyst, University of Calgary

description

Experiences with Amazon Web Services and thoughts on Cloud Computing presented at Cybera Summit 08 in Banff, Canada.

Transcript of Cloud Computing in Practice

Page 1: Cloud Computing in Practice

Cloud Computing in Practice

King Chung HuangTechnical Solutions Analyst, University of Calgary

Page 2: Cloud Computing in Practice

Using services in the cloud, develop a large-scalevideo conversion system.”

Page 3: Cloud Computing in Practice

What is Cloud Computing?

Page 4: Cloud Computing in Practice
Page 5: Cloud Computing in Practice

whatis.comdefinition of Cloud Computing

Cloud computing is simply a buzzword used to repackage grid

computing and utility computing, both of which have existed for

decades.”

Page 6: Cloud Computing in Practice

Larry Ellisonduring Oracle’s Analyst Day

The interesting thing about cloud computing is that we’ve

redefined cloud computing to include everything that we

already do. […] The computer industry is the only industry that

is more fashion-driven than women’s fashion. Maybe I’m an idiot,

but I have no idea what anyone is talking about. What is it? It’s

complete gibberish. It’s insane. When is this idiocy going to stop?

Page 7: Cloud Computing in Practice

Larry Ellisonduring Oracle’s Analyst Day

The interesting thing about cloud computing is that we’ve

redefined cloud computing to include everything that we

already do. […] The computer industry is the only industry that

is more fashion-driven than women’s fashion. Maybe I’m an idiot,

but I have no idea what anyone is talking about. What is it? It’s

complete gibberish. It’s insane. When is this idiocy going to stop?

Page 8: Cloud Computing in Practice

Getting Started

Page 9: Cloud Computing in Practice

Infrastructure Services

Elastic Compute Cloud

Simple Storage Service

Simple Queue Service

SimpleDB

Payments & Billing

Flexible Payments Service

DevPay

On-Demand Workforce

Mechanical Turk

Web Search & Information

Web Search

Web Information Service

Top Sites

Site ThumbnailFulfillment & Associates

Fulfillment Web Service

Associates Web Service

Page 10: Cloud Computing in Practice

Infrastructure Services

Elastic Compute Cloud

Simple Storage Service

Simple Queue Service

SimpleDB

Payments & Billing

Flexible Payments Service

DevPay

On-Demand Workforce

Mechanical Turk

Web Search & Information

Web Search

Web Information Service

Top Sites

Site ThumbnailFulfillment & Associates

Fulfillment Web Service

Associates Web Service

Page 11: Cloud Computing in Practice

Infrastructure Services

Elastic Compute Cloud

Simple Storage Service

Simple Queue Service

SimpleDB

Payments & Billing

Flexible Payments Service

DevPay

On-Demand Workforce

Mechanical Turk

Web Search & Information

Web Search

Web Information Service

Top Sites

Site ThumbnailFulfillment & Associates

Fulfillment Web Service

Associates Web Service

Page 12: Cloud Computing in Practice

Amazon Mechanical Turk• Marketplace for work that requires human intelligence

■ Enables programmatic distribution of tasks that require human intelligence

• Human Intelligence Tasks (HITs)■ Desired output■ Format of output■ Pay rate

• Only pay for quality work■ Review results and pay for accepted work

Page 13: Cloud Computing in Practice
Page 14: Cloud Computing in Practice

Ten Thousand Cents• Drawing collected from November 2007 to March 2008• Total labour paid: US$100

■ 1¢ per part × 10 000 parts• Prints available for purchase

■ $100 each

Page 15: Cloud Computing in Practice

Video Conversion Plan• Upload source content to Simple Storage Service (S3)• Instantiate virtual machines on Elastic Compute Cloud (EC2)

to perform conversions■ Be able to instantiate more conversion machines as needed

to scale to demand■ Use Simple Queue Service (SQS) to queue requests

• Log status and results in SimpleDB (SDB)■ Was not able to gain access during beta period

• Deliver conversion results from S3

Page 16: Cloud Computing in Practice

Accessing Infrastructure Services• Web service APIs

■ SOAP and REST• Many applications/plugins support S3

■ Transmit on Mac OS X■ S3Fox for Firefox

• AWS Developer Community provides lots of documentation and sample code■ JavaScript, PHP, Python

• Many public machine images for EC2 are available■ Use them as a starting point for custom machines

• In actuality, you rarely have to start from scratch

Page 17: Cloud Computing in Practice

Pricing• Pay only for what you use

■ Data transfer■ Data storage■ Instance time■ Transactions

Page 18: Cloud Computing in Practice
Page 19: Cloud Computing in Practice
Page 20: Cloud Computing in Practice
Page 21: Cloud Computing in Practice

PricingSimple Storage Service (United States)

Storage 15¢ per GB-month

Data Transfer In 10¢ per GB

Data Transfer Out 10¢–17¢ per GB

PUT, POST, or LIST 1.0¢ per 1000 requests

GET 1.0¢ per 10000 requests

Page 22: Cloud Computing in Practice

PricingSimple Storage Service (Europe)

Storage 18¢ per GB-month

Data Transfer In 10¢ per GB

Data Transfer Out 10¢–17¢ per GB

PUT, POST, or LIST 1.2¢ per 1000 requests

GET 1.2¢ per 10000 requests

Page 23: Cloud Computing in Practice

PricingSimple Queue Service

Storage none

Data Transfer In 10¢ per GB

Data Transfer Out 10¢–17¢ per GB

Requests 1.0¢ per 10000 requests

Page 24: Cloud Computing in Practice

PricingSimple Queue Service (Old API, prior to 2008)

Storage none

Data Transfer In 10¢ per GB

Data Transfer Out 10¢–17¢ per GB

Requests 1.0¢ per 10000 requests

Messages 10¢ per 1000 messages

Page 25: Cloud Computing in Practice

PricingSimple Queue Service (Old API, prior to 2008)

Impact of the Price Change

We examined the effect that the new pricing would have had on Amazon SQS charges billed at the end of December 2007. Under the new plan, 76% of customers with bills greater than $1 would have received lower bills, saving an average of 71% each compared to their actual bill.source: http://aws.amazon.com/sqs/

Page 26: Cloud Computing in Practice

PricingElastic Compute Service

Instances 10¢–80¢ per hour

Data Transfer In 10¢ per GB

Data Transfer Out 10¢–17¢ per GB

Page 27: Cloud Computing in Practice

PricingFreebies

• Data transfer between EC2 instances are free■ Instances must be in the same availability zone■ Instances must address each other by private IP addresses

• Data transfer between EC2 instances and S3 are free• Data transfer between EC2 instances and SQS are free

Page 28: Cloud Computing in Practice

PricingElastic IP Addresses (EC2)

• IPv4 Addresses are scarce• Instances are dynamically assigned a public IP address

and a private IP address• IPv4 addresses can be statically allocated and used for instances

■ No cost while in use■ 1¢ per non-attached Elastic IP address per hour

Page 29: Cloud Computing in Practice

Nuances

Page 30: Cloud Computing in Practice
Page 31: Cloud Computing in Practice

• Storage is organized in buckets■ Like a namespace for the objects it contains■ Accessible via http://bucketname.s3.amazonaws.com

• It’s not file storage, it’s a key-value store■ Like a big hash table or dictionary■ Key-value pairs

■ Movies/My Movie.mp4 ➜ ftypmp42isom5eiomdat9af…■ UserHomePage ➜ http://www.ucalgary.ca/~kchuang/

• Implicit BitTorrent seeding for all keys

Simple Storage Service (S3)

Page 32: Cloud Computing in Practice

Elastic Compute Cloud (EC2)• Machine images are templates

■ Run multiple instances from the same image■ Appliance model

• Data can be passed to instances at startup■ Provide input to an instance■ Negates the need to communicate to an instance

• Storage is independent of the machine■ By default, instance storage is transient■ Elastic Block Storage can be attached/detached as needed

■ Lifecycle is independent of instances

Page 33: Cloud Computing in Practice

Beyond Raw Utilities• Additional facilities around traditional infrastructure elements

increases their usability■ Fits well with on-demand, only what you need usage model■ Enables uses that were previously not possible

Page 34: Cloud Computing in Practice

Speed Bumps

Page 35: Cloud Computing in Practice

Reality BitesSimple Storage Service

• S3 objects have a maximum size of 5 GB■ Split objects like machine images

• Changing one byte means reinserting the entire object• Renaming (re-keying) an object also means reinserting

■ New beta API allows for object moves within a bucket• Various bugs in third-party apps and S3 itself

■ Inserting objects between 2 to 4 GB can be difficult• Bandwidth can be a significant barrier

■ Project goal of inserting 1 TB would have taken 168 days

Page 36: Cloud Computing in Practice

Reality BitesElastic Compute Cloud

• Making a change means recreating an entire image• Default storage is transient

■ Lasts only as long as the instance it is attached to■ Elastic Block Storage can only be attached to a single

instance at a time• Instances are billed by the hour

■ Constantly starting and stopping short-run instancescan be costly

Page 37: Cloud Computing in Practice

All Together, Now!

Page 38: Cloud Computing in Practice

• Completely implemented in JavaScript *■ Calls Amazon services directly via REST APIs

• Contacts S3 to retrieve stored videos• Converts video on demand

■ Writes jobs to an SQS queue■ Invokes EC2 instances, which reads from job queue and

performs conversion

Cumulus

* time constraints necessitated the use of some existing PHP sample code

Page 39: Cloud Computing in Practice

Demo

Page 40: Cloud Computing in Practice

Project Timeline

7

14

21

28

31

August 26

September 29

Page 41: Cloud Computing in Practice

Project Timeline

7

14

21

28

31

August 26

September 29

8/26: project kickoff8/29: project planning

Page 42: Cloud Computing in Practice

Project Timeline

7

14

21

28

31

August 26

September 29

9/2: work begins

Page 43: Cloud Computing in Practice

Project Timeline

7

14

21

28

31

August 26

September 29

9/8: daapd server abandoned

9/5: slow upload speeds

Page 44: Cloud Computing in Practice

Project Timeline

7

14

21

28

31

August 26

September 29

9/11: attempting video conversion

9/12: visiting clouds

Page 45: Cloud Computing in Practice

Project Timeline

7

14

21

28

31

August 26

September 29

9/18: bandwidth increased

9/18: first video converted

Page 46: Cloud Computing in Practice

Project Timeline

7

14

21

28

31

August 26

September 29

9/22: creating front-end web app

9/26: starting presentation

Page 47: Cloud Computing in Practice

Project Timeline

7

14

21

28

31

August 26

September 29

9/29: still working on presentation

Page 48: Cloud Computing in Practice

Project Timeline

7

14

21

28

31

August 26

September 29

Page 49: Cloud Computing in Practice

By the Numbers

working daysweekendstransferredinstance hoursspentmiles

192

70 GB321

$41.6016324

as of September 27, 2008

Page 50: Cloud Computing in Practice

Lessons Learned

Page 51: Cloud Computing in Practice

Cloud Computing is more than Raw Utilities

Page 52: Cloud Computing in Practice

Cloud ComputingEnables Tinkering

Page 53: Cloud Computing in Practice

Bandwidth Can Be Problematic

Page 54: Cloud Computing in Practice

Centralization Results in Centralization of Risk

Page 55: Cloud Computing in Practice

Be Aware ofService Level Agreements

Page 56: Cloud Computing in Practice

More Information

King Chung HuangTechnical Solutions Analyst, University of [email protected]

Patrick MannChief Technology Officer, [email protected]

Cloud Computing White Papercoming soonhttp://www.cybera.ca

Page 57: Cloud Computing in Practice

Q&A