The document discusses how to run applications on Amazon EC2. It covers choosing a region and availability zone, defining the architecture, selecting instance types, bootstrapping and configuring instances, deploying applications, and scaling. Key points include using Chef for configuration management, deploying with Capistrano hooks, and addressing issues with idempotency and documentation. The goal is to set up a browser game with 1.2 million daily users on over 130 EC2 instances to handle 120,000 requests per minute.
7. Running on EC2
Steps to complete
Choose region and availability zone
Define architecture
Choose instance types and AMI
Boot & configure instances
Deploy application
…
Profit
7
8. Region and Availability Zone
Regions
Individual EC2 installations
Multiple datacenters a.k.a availability zones
Small differences in pricing
US-east usually gets features first
Availability Zone
Datacenter of instances & volumes
Differently named for different accounts
Traffic within the same zone is free
Different Instance type availability
8
15. Elastic IP
Static, public IP in contrast to
instance IP
Associate to any instance (~15s)
Paying when not in use
Use for DNS of load balancer
15
16. Elastic Block Store EBS
Network based block device: 1GB – 1TB
Persistent & redundant
Can be used by one instance at a time
Incremental Snapshots
RAID for better performance
16
17. Elastic Load Balancer ELB
Managed Load Balancer
Auto-Scales via Round Robin DNS
Can start/stop instances
Slower and not as flexible as
instance + HAProxy
The only way to scale past 1 Gbit/s!
17
18. Relational Data Store RDS
Managed MySQL instance
Choose instance size,
pay ~ 30% premium
Hot-Failover and read replication
available
Define a 4h maintenance window
Better performance than single EBS-
backed instance
18
19. Instance Types
Hourly Cost Monthly Cost
RAM Cores x ECU Arch
(US-East) (US-East)
Micro
Tiny 613 MB Burst 1 x 2 32bit/64bit $0.02 $15
Standard
Small 1.7 GB 1x1 32bit $0.085 $62
Large 7.5 GB 2x2 64bit $0.34 $248
Extra Large 15 GB 4x2 64bit $0.68 $496
High-Memory
Extra Large 17.1 GB 2 x 3.25 64bit $0.50 $366
Double Extra Large 34.2 GB 4 x 3.25 64bit $1.00 $732
Quadruple Extra Large 68.4 GB 8 x 3.25 64bit $2.00 $1464
High-CPU
Medium 1.7 GB 2 x 2.5 32bit $0.17 $124
Extra Large 7 GB 8 x 2.5 64bit $0.68 $496
1 ECU = 1.0 – 1.2 GHz Opteron/Xeon from 2007 19
20. Recommendation
Start with
Small for load balancer
Medium for App server
Large for DB server
Tiny for monitoring and utility
Grow to
XL-HighCPU for load balancer
XL-HighCPU for App server
XL-HighMemory for DB server
20
25. Instance Bootstrap
2 Approaches
Images
One image for every server type
All software pre-installed
Few moving parts
Fast boot
25
26. Instance Bootstrap
2 Approaches
Images Scripted
One image for every server type One image to rule them all
All software pre-installed Smallest common denominator
Few moving parts Acquires configuration on start
Fast boot Installs & configures during
boot process to fit role
All parts moving
Slower boot
26
27. Instance Bootstrap
2 Approaches
Images Scripted
One image for every server type One image to rule them all
All software pre-installed Smallest common denominator
Few moving parts Acquires configuration on start
Fast boot Installs & configures during
boot process to fit role
All parts moving
Slow boot
27