Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Elastic Grid Talk at JavaOne 08 (San Francisco, USA)
1. Elastic Grid and EC2
How Can Amazon EC2 Benefit from the Elastic Grid
Solution?
Dennis Reedy
Jerome Bernard
2. Agenda
EC2 and Amazon Web Services
• Capabilities, benefits and challenges
Elastic Grid introduction
• Technology, approach and benefits
Elastic Grid and EC2
• Deploying and scaling applications using Elastic Grid
Demonstration
2008 JavaOneSM Conference | java.com.sun/javaone | 2
3. Cloud Computing
A way to increase capacity or add capabilities on the fly
without investing in new infrastructure, training new
personnel, or licensing new software
Virtualized hardware available for computation
• Resources “in the cloud”
Low cost of entry, utility based model
• Pay for what you use
Embraced by startups, and medium to large corporations as
a way to bypass IT
Cloud Computing Providers (Utility)
• Amazon, Sun, IBM, 3Tera
2008 JavaOneSM Conference | java.com.sun/javaone | 3
4. Amazon EC2 Overview
In a nutshell
• Provides resizable compute capacity in the cloud
EC2 Amazon Machine Image (AMI)
• Operating System & application “stack”
• Deployed using Amazon Web Services to the “cloud”
EC2 Instances
• Virtual machines that run AMIs
2008 JavaOneSM Conference | java.com.sun/javaone | 4
9. EC2 AMIs: Deployment Challenges
The EC2 AMI is a boot image, requires substantial system
administrator knowledge
As application code changes, AMIs typically need to change
Not focused on developer productivity
Boot base AMI
Copy private key and
Upload to S3 certificate (for bundling
image)
Install and configure
requisite software
2008 JavaOneSM Conference | java.com.sun/javaone | 8
10. Elastic Grid
Dynamic infrastructure for the dynamic deployment,
activation, management of Java applications on virtualized
hardware
Technology building blocks
• Rio
• Typica
• Jets3t
• Jini (River)
2008 JavaOneSM Conference | java.com.sun/javaone | 9
16. EC2 AMIs: Deployment with EG AMIs
EG AMIs are pre-set, no need to (re-)bundle
As application code changes, upload to S3 and deploy
Focuses on developer productivity
Boot EG AMIs
Deploy ...
Upload (modified)
app to S3 2008 JavaOneSM Conference | java.com.sun/javaone | 12
17. Elastic Grid Deployment
Deploy application code S3
1 Upload S3
Command to deploy the
application is made
3 As needed download
All code is dynamically served application resources
and instantiated
Application is monitored 2 Deploy
activate
and managed across EC2
instances Application
Monitors
Application Agents
2008 JavaOneSM Conference | java.com.sun/javaone | 13
18. Elastic Grid Scalability on EC2
Across existing AMIs
App Agent AMI App Monitor AMI
SLA
App Service Policy Handler
80% allocate
Memory
Observer register
• Allocate an Application Service
• Create SLA Policy Handler
that registers for Memory
utilization notifications
• SLA has upper limit set to 80%
2008 JavaOneSM Conference | java.com.sun/javaone | 14
19. Elastic Grid Scalability on EC2
Across existing AMIs
App Agent AMI App Monitor AMI
SLA
App Service Policy Handler increment
80%
Memory
Observer notify
• Memory utilization exceeds 80%
• SLA Policy Handler is notified
• App Monitor allocates another
Application Service instance to
appropriate App Agent AMI
2008 JavaOneSM Conference | java.com.sun/javaone | 15
20. Elastic Grid Scalability on EC2
Across existing AMIs
App Agent AMI App Monitor AMI
SLA
App Service Policy Handler increment
80%
Memory
Observer notify
• Memory utilization exceeds 80%
• SLA Policy Handler is notified
• App Monitor allocates another
Application Service instance to
appropriate App Agent AMI
2008 JavaOneSM Conference | java.com.sun/javaone | 15
21. Elastic Grid Scalability on EC2
New EC2 Instance
App Agent AMI App Monitor AMI
EC2
App Service Policy Handler
80% allocate
Memory
Observer
• Allocate an Application Service
• Create EC2 Policy Handler
which registers for Memory
utilization notifications
• SLA has upper limit set to 80%
2008 JavaOneSM Conference | java.com.sun/javaone | 16
22. Elastic Grid Scalability on EC2
New EC2 Instance
App Agent AMI App Monitor AMI
SLA
App Service Policy Handler increment
80%
Memory
Observer
notify
2008 JavaOneSM Conference | java.com.sun/javaone | 17
23. Elastic Grid Scalability on EC2
New EC2 Instance
App Agent AMI App Monitor AMI
SLA
App Service Policy Handler increment
80%
Memory
Observer App Agent AMI
notify
App Service SLA
Policy Handler
Memory
Observer
2008 JavaOneSM Conference | java.com.sun/javaone | 17
24. Elastic Grid Benefits
So what EG does for the app?
• Ease development and deployment of Java applications
using Amazon services
• Provides automated management, fault detection and
scalability for the application
Why EG should be used
• Ease deployment and management of your Java
applications
2008 JavaOneSM Conference | java.com.sun/javaone | 18
25. Elastic Grid Tools
Tools Used in the Demonstration
IntelliJ plugin Rio UI
Web Console
2008 JavaOneSM Conference | java.com.sun/javaone | 19
26. Demonstration – A real world use case
The Problem
French TV channel in need of video conversion for streaming
of short videos on the Web
• for now on..
• VOD will come really soon
• ...and CatchUp TV is close too, I suppose!
Video conversion and streaming
• done by a 3rd party,
• but there are streaming issues and some conversion glitches
As of the beginning of April 08,
• more than 1.1K videos...
• ... for about 40GB of MPEG-4 data!
2008 JavaOneSM Conference | java.com.sun/javaone | 20
27. Demonstration – A real world use case
The Problem
Pricing:
• 7€/GB for streaming,
• 300€/month for video conversion, that is $438 $456 per month!
per month! month!
$474 per
This solution won’t scale:
• about 30 videos per day...
• ... for 1.5GB of MPEG-4
• being converted on 1 machine!
2008 JavaOneSM Conference | java.com.sun/javaone | 21
28. Demonstration – A real world use case
The Problem
Pricing:
• 7€/GB for streaming,
• 300€/month for video conversion, that is $438 $456 per month!
per month! month!
$474 per
This solution won’t scale:
• about 30 videos per day...
• ... for 1.5GB of MPEG-4
• being converted on 1 machine!
2008 JavaOneSM Conference | java.com.sun/javaone | 21
29. Demonstration – A real world use case
The Problem
Pricing:
• 7€/GB for streaming,
• 300€/month for video conversion, that is $438 $456 per month!
per month! month!
$474 per
This solution won’t scale:
• about 30 videos per day...
• ... for 1.5GB of MPEG-4
• being converted on 1 machine!
2008 JavaOneSM Conference | java.com.sun/javaone | 21
30. Demonstration – A real world use case
The Objectives
Storage should be cheap
• MPEG-4 videos and FLV videos should be stored on Amazon S3
Streaming should be fast and reliable
• cheap CDN in order to increase both the bps and the QoS
• being served from our FLV videos on Amazon S3
Flexibility of deployments for video conversion
• should be able to both on a LAN
• ... and EC2 infrastructure!
Flexibility of deployments for video conversion
• don’t want to wait for hours...
2008 JavaOneSM Conference | java.com.sun/javaone | 22
32. Demonstration Iterations
Approach 1
• LAN based approach using single computer
• Using automated SLA management
• System scales based on observed thresholds
Approach 2
• EC2 based deployment, using EG AMIs
• Dynamic deployment of application to EC2 from S3
• Using automated SLA management
• System scales application instances (as opposed EC2 instances) based
on observed thresholds
2008 JavaOneSM Conference | java.com.sun/javaone | 24
33. Demonstration – 1st approach
Local/network file system for both the MPEG-4 videos and
the converted videos (FLV).
Distribution of video conversion requests:
• done by our “smart proxy” sending Amazon SQS messages
• .. with the name of the video to convert
Video conversion done on machines on the LAN
• those machines needs access to the MPEG-4 videos!
Use of a dynamic service (with the help of the EG
framework)
• driving the mencoder OpenSource tool
• each Video Converter polls the SQS queue for requests
2008 JavaOneSM Conference | java.com.sun/javaone | 25
36. Demonstration – 2nd approach
Same as before, but this time, the cluster is hosted on
Amazon EC2!
The videos were previously uploaded on S3!
Each service running on Amazon EC2:
• downloads the S3 video from a “bucket”,
• convert it to the many FLV flavors,
• and uploads the encoded videos to another “bucket”
2008 JavaOneSM Conference | java.com.sun/javaone | 27
39. Video Conversion for Streaming of Short
Videos
2008 JavaOneSM Conference | java.com.sun/javaone | 29
40. Summary
Elastic Grid extends EC2, enabling users to manage &
dynamically scale application service instances and AMIs
based on declarable SLAs
Cloud decides allocation of services
• QoS approach provides feedback mechanisms based on SLAs
• Today: Human decides/admins each machine
Provisioning/changing services is simple
• Dynamic reconfigurable systems
• Make it live through the network
Availability
• EG EC2 AMI is available (easy to find with the IntelliJ plugin :))
ami-c140a5a8
Check the Elastic Grid blog for updates and status
2008 JavaOneSM Conference | java.com.sun/javaone | 30
41. Elastic Grid and EC2
How Can Amazon EC2 Benefit from the Elastic Grid
Solution?
Dennis Reedy dennis.reedy@elastic-grid.com
Jerome Bernard jerome.bernard@elastic-grid.com
BOF-5105
43. Demonstration – 2nd approach
Same as before, but this time, EG drives scalability with
watches on both CPU usage and SQS queue size
[Insert here the opstring addition]
Still running outside of Amazon EC2 world!
2008 JavaOneSM Conference | java.com.sun/javaone | 33
44. Demonstration – 2nd approach - Results
No performance hit
• Running on QuadCore – Win. increases total time by 47s,
• Running on 2xQuadCore – Mac. increases total time by 47s,
• Due to the lowerDampener and upperDampener set to 60s
No more instances running than what’s needed!
EG scales the number of SQS “workers” according to the SQS
queue length and how much CPU is used.
EG can quickly provision/unprovision “workers” based on
those metrics!
2008 JavaOneSM Conference | java.com.sun/javaone | 34
45. Demonstration – 3rd approach
Same as before, but this time, both the MPEG-4 and FLV
videos are put on Amazon S3.
This means uploading the local MPEG-4 videos to S3: this
work is done by our JSB smart proxy!
• No change on the client!
Each SQS “worker”:
• downloads the MPEG-4 video from an Amazon S3 “bucket”,
• convert it to many FLV formats,
• and uploads the results to another “bucket”
Still running out of Amazon EC2 world!
2008 JavaOneSM Conference | java.com.sun/javaone | 35
46. Demonstration – 3rd approach - Results
This solution trades CPU for bandwidth
• Something not optimal for a LAN cluster!
Upload bandwidth is the limiting factor:
• On ADSL-2+, max at 60KBps, total processing time becomes an issue!
• This means a bit more than 9 days for 45GB!
Solution: copy the MPEG-4 videos on a disk, go to your
datacenter facility, connect the drive, copy the content and
upload from there!
Billing is not optimal: billed for uploading of MPEG-4,
downloading of MPEG-4 and uploading of FLV files!
2008 JavaOneSM Conference | java.com.sun/javaone | 36
47. Challenges
AMI creation & management
• Application changes result in changes to AMI
• Re-“push” & deploy
Application Management
• Fault Detection & Recovery
• Application reliability
Scalability
• Making your application meet service level objectives
Accounting
• Fine-grained accounting
• Pay for what you use
2008 JavaOneSM Conference | java.com.sun/javaone | 37
48. Rio
Policy-Based infrastructure automating the deployment and
execution of distributed applications
• Measure Responses against Service Level Agreements
• Dynamic execution fabric
• Platform and application aware
Providing …
• Deployment & management capabilities
• POJO-based development approach
• Fault detection and recovery
• SLA Management
• Declarative service model
Built on
• Java and Jini technologies
2008 JavaOneSM Conference | java.com.sun/javaone | 38
49. Demonstration – A real world use case
The Problem
French TV channel in need of video conversion for streaming
of short videos on the Web
• for now on..
• VOD will come really soon
• ...and CatchUp TV is close too, I suppose!
Video conversion and streaming
• done by a 3rd party,
• but there are streaming issues and some conversion glitches
As of the beginning of April 08,
• more than 1.1K videos...
• ... for about 45GB of MPEG-4 data!
2008 JavaOneSM Conference | java.com.sun/javaone | 39
50. Demonstration – A real world use case
The Problem
Pricing:
• 7€/GB for streaming,
• 300€/month for video conversion, that is $438 $456 per month!
per month! month!
$474 per
This solution won’t scale:
• about 30 videos per day...
• ... for 1.5GB of MPEG-4
• being converted on 1 machine!
2008 JavaOneSM Conference | java.com.sun/javaone | 40
51. Demonstration – A real world use case
The Problem
Pricing:
• 7€/GB for streaming,
• 300€/month for video conversion, that is $438 $456 per month!
per month! month!
$474 per
This solution won’t scale:
• about 30 videos per day...
• ... for 1.5GB of MPEG-4
• being converted on 1 machine!
2008 JavaOneSM Conference | java.com.sun/javaone | 40
52. Demonstration – A real world use case
The Problem
Pricing:
• 7€/GB for streaming,
• 300€/month for video conversion, that is $438 $456 per month!
per month! month!
$474 per
This solution won’t scale:
• about 30 videos per day...
• ... for 1.5GB of MPEG-4
• being converted on 1 machine!
2008 JavaOneSM Conference | java.com.sun/javaone | 40
53. Demonstration – A real world use case
The Objectives
Storage should be cheap
• MPEG-4 videos and FLV videos should be stored on Amazon S3
Streaming should be fast and reliable
• cheap CDN in order to increase both the bps and the QoS
• being served from our FLV videos on Amazon S3
Flexibility of deployments for video conversion
• should be able to both on a LAN
• ... and EC2 infrastructure!
Flexibility of deployments for video conversion
• don’t want to wait for hours...
2008 JavaOneSM Conference | java.com.sun/javaone | 41
54. Demonstration Iterations
Approach 1
• LAN based approach using single computer
• Using automated SLA management
• System scales based on observed thresholds
Approach 2
• EC2 based deployment, using EG AMIs
• Dynamic deployment of application to EC2 from S3
• Using automated SLA management
• System scales application instances (as opposed EC2 instances*) based
on observed thresholds
2008 JavaOneSM Conference | java.com.sun/javaone | 42
55. Demonstration – 1st approach
Local/network file system for both the MPEG-4 videos and
the converted videos (FLV).
Distribution of video conversion requests:
• done by our “smart proxy” sending Amazon SQS messages
• .. with the name of the video to convert
Video conversion done on machines on the LAN
• those machines needs access to the MPEG-4 videos!
Use of a Rio JSB (with the help of the EG framework)
• driving the mencoder OpenSource tool
• each JSB polls the SQS queue for requests
2008 JavaOneSM Conference | java.com.sun/javaone | 43
58. Demonstration – 4th approach
Same as before, but this time, the cluster is hosted on
Amazon EC2!
This means a LAN client uploading the local videos to S3:
• just as before this work is done by our JSB “smart proxy”.
Each SQS “worker” on Amazon EC2:
• downloads the S3 video from a “bucket”,
• convert it to the many FLV flavors,
• and uploads the encoded videos to another “bucket”
2008 JavaOneSM Conference | java.com.sun/javaone | 45
59. Demonstration – 4th approach
EG starts new Amazon EC2 instances based on CPU usage
and the length of the SQS queue!
Accordingly to how the SLAs are configured
• [Insert here the OpString extract]
2008 JavaOneSM Conference | java.com.sun/javaone | 46
60. Demonstration – 4th approach - Results
Slower on a per instance basis, but can scale to tens, or
hundreds of instances in order to run this in a timely
fashion!
Upload bandwidth still is the limiting factor!
• Investment needed on LAN to S3 bandwidth
• Prefer a symmetric connection, like SDSL or Fiber or Cable.
The billing problem of the 3rd approach is gone
• because the bandwidth between EC2 and S3 is free
• $8.55/month for MPEG-4
• $5.7 for upload
• $5.82/month for FLV
• + EC2 fees depending on the number of videos to convert.
2008 JavaOneSM Conference | java.com.sun/javaone | 47
61. Demonstration – 4th approach - Results
EC2 advantages:
• Converting 1.1K videos on 1 instances cost as much as converting 1.1K
videos on 100 instances
• Unless you need each instance less than an hour => Amazon, you
should really per minute/CPU or second/CPU!
EG advantages:
• You don’t need much work in order to do this: simply declare the
appropriate Scaling Policy Handler in your OpString!
• You can develop/test on your LAN and deploy on Amazon EC2.
2008 JavaOneSM Conference | java.com.sun/javaone | 48