Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Running on Amazon EC2Jonathan Weiss
ScalariumAmazon EC2 Cluster Management   Auto-Config   Self-Healing   Auto-Scaling   One-click-deploymentwww.scalarium....
3
Amazon Elastic Compute Cloud                   Virtual Server via API call                   Pay per hour                 ...
EC2 Features               Spot instances               Elastic IP               Elastic Load Balancing               Clou...
Running on EC2Setting up an app                    6
Running on EC2Steps to complete   Choose region and availability zone   Define architecture   Choose instance types and ...
Region and Availability ZoneRegions   Individual EC2 installations   Multiple datacenters a.k.a availability zones   Sm...
Existing Availability ZonesUS-EAST-1        US-WEST-1        EU-WEST-1        AP-SOUTHEAST-1   us-east-1a      us-west-1...
Single AZ DeploymentMost common and simple setupNot very different from typical setup                                     ...
Multi AZ Deployment                      11
Architecture               12
Architecture               13
Architecture               14
Elastic IP  Static, public IP in contrast to  instance IP  Associate to any instance (~15s)  Paying when not in use  U...
Elastic Block Store EBS  Network based block device: 1GB – 1TB  Persistent & redundant  Can be used by one instance at ...
Elastic Load Balancer ELB  Managed Load Balancer  Auto-Scales via Round Robin DNS  Can start/stop instances  Slower an...
Relational Data Store RDS  Managed MySQL instance  Choose instance size,  pay ~ 30% premium  Hot-Failover and read repl...
Instance Types                                                                 Hourly Cost   Monthly Cost                 ...
RecommendationStart with   Small for load balancer   Medium for App server   Large for DB server   Tiny for monitoring...
Reserved Instances                     Pay amount upfront and you get:                      Hourly price ~ 33%            ...
Running on EC2Steps to complete  Choose region and availability zone  Define architecture  Choose instance types   Boot...
Instance ConfigurationFrom blank Linux to your PHP app server                                          23
Instance Bootstrap                2 Approaches                               24
Instance Bootstrap                                  2 Approaches                 Images    One image for every server typ...
Instance Bootstrap                                  2 Approaches                 Images                                Scr...
Instance Bootstrap                                  2 Approaches                 Images                                Scr...
ChefOpen Source Provisioning Tool   Configures your servers   Cookbooks & recipes   Ruby DSL                            ...
Chef       29
Chef Solo            30
MemcachedSolo                31
Chef Solo Run Configuration JSON Run Chef Solo                     32
DeployingDeploy resource   Compatible with Capistrano layout   Supports Capistrano hooks via deploy/hook_name.rb   Asyn...
Chef Experiences           Great so far, but              Not idempotent              Unintuitive 2 phases             ...
Running on EC2Steps to complete  Choose region and availability zone  Define architecture  Choose instance types  Boot ...
The Project              Browser game hosted on EC2              1.2 million Daily Active Users (DAU)              ~ 130 s...
Flexibility and Scalability
Flexibility and Scalability
Q&APeritor GmbHBlücherstr. 22, Hof III Aufgang 610961 BerlinTel.: +49 (0)30 69 20 09 84 0Fax: +49 (0)30 69 20 09 84 9Inter...
Upcoming SlideShare
Loading in …5
×

Running on Amazon EC2

4,837 views

Published on

Platforms like Amazon EC2 promise scalable and redundant systems for a couple of pennies. As soon as you start to build complex systems or migrate existing apps there are many knobs to set. This talk will explain how you can create and deploy reliable and redundant applications to EC2 and will point out all the little things you need to know, like how to automatically provision new servers with tools like Chef.

Presented by Jonathan Weiss at PHP UK Conference 2011 in London.

Published in: Technology
  • Be the first to comment

Running on Amazon EC2

  1. 1. Running on Amazon EC2Jonathan Weiss
  2. 2. ScalariumAmazon EC2 Cluster Management   Auto-Config   Self-Healing   Auto-Scaling   One-click-deploymentwww.scalarium.com 2
  3. 3. 3
  4. 4. Amazon Elastic Compute Cloud Virtual Server via API call Pay per hour Different instance types in different regions 4
  5. 5. EC2 Features Spot instances Elastic IP Elastic Load Balancing CloudWatch Auto Scaling Virtual Private Cloud  Elastic Block Storage 5
  6. 6. Running on EC2Setting up an app 6
  7. 7. Running on EC2Steps to complete   Choose region and availability zone   Define architecture   Choose instance types and AMI   Boot & configure instances   Deploy application   …   Profit 7
  8. 8. Region and Availability ZoneRegions   Individual EC2 installations   Multiple datacenters a.k.a availability zones   Small differences in pricing   US-east usually gets features firstAvailability Zone   Datacenter of instances & volumes   Differently named for different accounts   Traffic within the same zone is free   Different Instance type availability 8
  9. 9. Existing Availability ZonesUS-EAST-1 US-WEST-1 EU-WEST-1 AP-SOUTHEAST-1   us-east-1a   us-west-1a   eu-west-1a   ap-southeast-1a   us-east-1b   us-west-1b   eu-west-1b   ap-southeast-1b   us-east-1c   us-west-1c   us-east-1d 9
  10. 10. Single AZ DeploymentMost common and simple setupNot very different from typical setup 10
  11. 11. Multi AZ Deployment 11
  12. 12. Architecture 12
  13. 13. Architecture 13
  14. 14. Architecture 14
  15. 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. 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. 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 + HAProxyThe only way to scale past 1 Gbit/s! 17
  18. 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. 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 $15Standard 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 $496High-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 $1464High-CPU Medium 1.7 GB 2 x 2.5 32bit $0.17 $124 Extra Large 7 GB 8 x 2.5 64bit $0.68 $4961 ECU = 1.0 – 1.2 GHz Opteron/Xeon from 2007 19
  20. 20. RecommendationStart with   Small for load balancer   Medium for App server   Large for DB server   Tiny for monitoring and utilityGrow to   XL-HighCPU for load balancer   XL-HighCPU for App server   XL-HighMemory for DB server 20
  21. 21. Reserved Instances Pay amount upfront and you get: Hourly price ~ 33% Guaranteed availability 24/7 instance cost: ~ 55% Recommended! 21
  22. 22. Running on EC2Steps to complete  Choose region and availability zone  Define architecture  Choose instance types   Boot & configure instances   Deploy application   …   Profit 22
  23. 23. Instance ConfigurationFrom blank Linux to your PHP app server 23
  24. 24. Instance Bootstrap 2 Approaches 24
  25. 25. Instance Bootstrap 2 Approaches Images   One image for every server type   All software pre-installed   Few moving parts   Fast boot 25
  26. 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. 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
  28. 28. ChefOpen Source Provisioning Tool   Configures your servers   Cookbooks & recipes   Ruby DSL 28
  29. 29. Chef 29
  30. 30. Chef Solo 30
  31. 31. MemcachedSolo 31
  32. 32. Chef Solo Run Configuration JSON Run Chef Solo 32
  33. 33. DeployingDeploy resource   Compatible with Capistrano layout   Supports Capistrano hooks via deploy/hook_name.rb   Async! 33
  34. 34. Chef Experiences Great so far, but   Not idempotent   Unintuitive 2 phases   Documentation could be better   Example Cookbooks often so so 34
  35. 35. Running on EC2Steps to complete  Choose region and availability zone  Define architecture  Choose instance types  Boot & configure instances  Deploy application   …   Profit 35
  36. 36. The Project Browser game hosted on EC2 1.2 million Daily Active Users (DAU) ~ 130 server ~ 120.000 requests per minute on average
  37. 37. Flexibility and Scalability
  38. 38. Flexibility and Scalability
  39. 39. Q&APeritor GmbHBlücherstr. 22, Hof III Aufgang 610961 BerlinTel.: +49 (0)30 69 20 09 84 0Fax: +49 (0)30 69 20 09 84 9Internet: www.peritor.comE-Mail: info@peritor.com© Peritor GmbH - Alle Rechte vorbehalten

×