SlideShare a Scribd company logo
1 of 37
Download to read offline
Skalieren von Rails Anwendungen
mit Amazon S3 und EC2




Jonathan Weiss, Peritor Wissensmanagement GmbH
22.06.2007, Rails Konferenz
Ausgangslage


               Eine Maschine:

               • Apache

               • Ruby / Rails

               • MySQL




                                2
Worst Case Popularität




                         3
Steiniger Weg




                4
Problem: Backup



• Hochverfügbar

• Redundant

• Große Datenmengen




                      5
Problem: File System


• Wichtige Dateien müssen allen Systemen zugänglich sein

• NFS / Samba unpraktikable Lösungen




                                                           6
Problem: Plötzliche Lastspitzen




                                  7
Problem: Ungleichmäßige
Belastung




                          8
Don‘t reinvent the wheel!




                            9
Amazon Web Services




    Simple Storage Service - S3    Elastic Compute Cloud - EC2   E-Commerce S..

  Redundanter Speicherplatz       Virtueller Server pro Stunde   …….
  $0,15 per GB Speicherplatz      $0,10 pro CPU Stunde
  $0,10 - $0,20 pro GB Traffic     $0,10 - $0,20 pro GB Traffic




                                                                            10
S3 - Simple Storage Service


• Beliebig viel redundanter, hochverfügbarer Speicherplatz

• max. 5 GB pro Datei

• Organisiert in „Buckets“

• Upload über Web Service API

• Abruf über
   • Web Service
   • HTTP / HTTPS
   • BitTorrent



                                                             11
S3 - Buckets

                                                               S3

• Unique über ganz S3

• Enthalten beliebig
                                    MyBucket_name         www.peritor.com
  viele Key-Value-Metadata Tupel
                                   foto_5.jpg            /site/screen.css
• Enthalten keine Buckets!
                                   /backups/januar.tgz   /site/script.js
• Key kann „/“ enthalten           /fotos/2007/001.png   FreeBSD-6.2.iso




                                                                            12
S3 mit AWS::S3
Upload




Download




                 13
EC2 - Elastic Compute Cloud

• XEN basiert

• (Beliebig) viele virtuelle Server steuerbar über Web Service
   • 1,7 GHz
   • 1,75 GB RAM
   • 160 GB lokaler Speicherplatz (nicht persistent!)

• Einsatz der Linux Distribution der Wahl (Linux 2.6.16),
  Verwaltung der Amazon Machine Images (AMI) auf S3

• ACLs regeln Zugriff auf Hosts / Ports



                                                                 14
EC2 Tools
 Verfügbare Images auflisten



Neue Instanz starten




Einloggen per SSH




Instanz beenden



                              15
Und jetzt?

Wie löse ich meine
Probleme damit?


                     16
S3 - Backup


• s3sync.rb     • S3Browser

• Brackup       • Firefox S3 Organizer extension

• Jungle Disk   •…

• S3 FUSE

• s3DAV

• Duplicity




                                                   17
s3sync.rb
Backup




Restore




            18
S3 als asset host




                    19
S3 als asset host

Setup DNS




Setup Rails Konfiguration




                           20
S3 als asset host

welcome.rhtml Template




Output




                         21
S3 - User Data Speicher




                          22
attachment_fu Rails plugin

Setup




                             23
attachment_fu Rails plugin

Upload




Download




                             24
On-Demand Computing mit EC2




Zeitgesteuert, z.B. mit cron




                               25
On-Demand Computing mit EC2




Lastgesteuert, z.B. mit Monit




                                26
On-Demand Computing mit EC2




                              27
Load Balancer / Proxy

                        Am Beispiel mod_proxy_blancer:

                        • Ansprechen von multiplen Backend-
                          Servern (Mongrel)

                        • Zentrale Proxy/Load-Balancer
                          Konfiguration mit Wissen über Nodes

                        • Typischerweise Neustart des Proxy bei
                          Veränderung der Backend-Server




                                                              28
Swiftiply
            Swiftiply Proxy:

            • Multiple Backend-Clients verbinden
              sich persistent zum Backendport

            • Proxy nimmt Anfragen über
              Clusterport entgegen und verteilt sie
              auf verbundene Clients




              Keine Re-Konfiguration nötig


                                                      29
Swiftiply Proxy

Installation      Konfiguration



Start




                                 30
Swiftiplied Mongrel

• Gem plugin um Mongrel zu patchen

• Wandelt Mongrel in Swiftiply-Client um

• Noch experimentell



Start



           oder



                                           31
EC2 on Demand vor Swiftiply




                              32
EC2 on Demand mit Swiftiply




                              33
EC2 on Demand mit Swiftiply




                              34
Ressourcen

• Amazon Web Services
  http://aws.amazon.com

• Swiftiply
  http://swiftiply.swiftcore.org

• Attachment_fu
  http://svn.techno-weenie.net/projects/plugins/attachment_fu/

• Elastic Rails
  http://www.elasticrails.com

• Capazon
  http://capazon.rubyforge.org

• RightScale
  http://www.rightscale.com

• WeoCEO
  http://weoceo.weogeo.com/


                                                                 35
Peritor Wissensmanagement GmbH
Lenbachstraße 2
12157 Berlin
Internet: www.peritor.com      Telefon: +49 (0)30 69 40 11 94
E-Mail: kontakt@peritor.com    Telefax: +49 (0)30 69 40 11 95


© Peritor Wissensmanagement GmbH - Alle Rechte vorbehalten
                                                                36
jobs@peritor.com




                   37

More Related Content

What's hot

Feedbox - ServerPush Implementierung
Feedbox - ServerPush ImplementierungFeedbox - ServerPush Implementierung
Feedbox - ServerPush Implementierung
Martin Wöginger
 
Grundlagen puppet
Grundlagen puppetGrundlagen puppet
Grundlagen puppet
inovex GmbH
 
FROSCON 2011: MySQL Replication
FROSCON 2011: MySQL ReplicationFROSCON 2011: MySQL Replication
FROSCON 2011: MySQL Replication
FromDual GmbH
 

What's hot (17)

Performance durch Caching
Performance durch CachingPerformance durch Caching
Performance durch Caching
 
Docker Workbench
Docker WorkbenchDocker Workbench
Docker Workbench
 
Feedbox - ServerPush Implementierung
Feedbox - ServerPush ImplementierungFeedbox - ServerPush Implementierung
Feedbox - ServerPush Implementierung
 
Grundlagen puppet
Grundlagen puppetGrundlagen puppet
Grundlagen puppet
 
MySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und ClusterMySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und Cluster
 
5 Tweaks für 500 % bessere Performance
5 Tweaks für 500 % bessere Performance5 Tweaks für 500 % bessere Performance
5 Tweaks für 500 % bessere Performance
 
MySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA'sMySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA's
 
Synology Workshop07 06
Synology Workshop07 06Synology Workshop07 06
Synology Workshop07 06
 
MySQL Backup/Recovery
MySQL Backup/RecoveryMySQL Backup/Recovery
MySQL Backup/Recovery
 
Wordpress on steroids
Wordpress on steroidsWordpress on steroids
Wordpress on steroids
 
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Infrastructure as code: Cloud-Umgebungen mit Terraform verwalten
Infrastructure as code: Cloud-Umgebungen mit Terraform verwaltenInfrastructure as code: Cloud-Umgebungen mit Terraform verwalten
Infrastructure as code: Cloud-Umgebungen mit Terraform verwalten
 
NoSQL with MySQL
NoSQL with MySQLNoSQL with MySQL
NoSQL with MySQL
 
Ceph Introduction @GPN15
Ceph Introduction @GPN15Ceph Introduction @GPN15
Ceph Introduction @GPN15
 
Nagios Conference 2007 | Vmware Monitoring by Ingo Latschner
Nagios Conference 2007 | Vmware Monitoring by Ingo LatschnerNagios Conference 2007 | Vmware Monitoring by Ingo Latschner
Nagios Conference 2007 | Vmware Monitoring by Ingo Latschner
 
FROSCON 2011: MySQL Replication
FROSCON 2011: MySQL ReplicationFROSCON 2011: MySQL Replication
FROSCON 2011: MySQL Replication
 

Viewers also liked

Ruby on Rails - Kurzvortrag
Ruby on Rails - KurzvortragRuby on Rails - Kurzvortrag
Ruby on Rails - Kurzvortrag
hen_drik
 
Actuated workbench
Actuated workbenchActuated workbench
Actuated workbench
hen_drik
 

Viewers also liked (9)

Ruby on Rails - Kurzvortrag
Ruby on Rails - KurzvortragRuby on Rails - Kurzvortrag
Ruby on Rails - Kurzvortrag
 
Theming cck-n-views
Theming cck-n-viewsTheming cck-n-views
Theming cck-n-views
 
Actuated workbench
Actuated workbenchActuated workbench
Actuated workbench
 
WILD&TAME Abschlussbericht
WILD&TAME AbschlussberichtWILD&TAME Abschlussbericht
WILD&TAME Abschlussbericht
 
Aila
AilaAila
Aila
 
The Kernel Trick
The Kernel TrickThe Kernel Trick
The Kernel Trick
 
Hacking Human Language (PyCon Sweden 2015)
Hacking Human Language (PyCon Sweden 2015)Hacking Human Language (PyCon Sweden 2015)
Hacking Human Language (PyCon Sweden 2015)
 
Hacking Human Language (PyData London)
Hacking Human Language (PyData London)Hacking Human Language (PyData London)
Hacking Human Language (PyData London)
 
word2vec - From theory to practice
word2vec - From theory to practiceword2vec - From theory to practice
word2vec - From theory to practice
 

Similar to Skalieren von Rails Anwendungen mit Amazon S3 und EC2

Cloud Computing am Beispiel dctp.tv
Cloud Computing am Beispiel dctp.tvCloud Computing am Beispiel dctp.tv
Cloud Computing am Beispiel dctp.tv
Fabian Topfstedt
 
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Michael Kirst-Neshva
 
Ruby on Rails in a metro session
Ruby on Rails in a metro sessionRuby on Rails in a metro session
Ruby on Rails in a metro session
Virttoo org
 

Similar to Skalieren von Rails Anwendungen mit Amazon S3 und EC2 (20)

SimpleDB - Chancen einer Cloud Datenbank
SimpleDB - Chancen einer Cloud DatenbankSimpleDB - Chancen einer Cloud Datenbank
SimpleDB - Chancen einer Cloud Datenbank
 
BizSpark goes Cloud
BizSpark goes CloudBizSpark goes Cloud
BizSpark goes Cloud
 
Icsug conf 14_tipps-und-skripts-fuer-ibm-connections-administratoren
Icsug conf 14_tipps-und-skripts-fuer-ibm-connections-administratorenIcsug conf 14_tipps-und-skripts-fuer-ibm-connections-administratoren
Icsug conf 14_tipps-und-skripts-fuer-ibm-connections-administratoren
 
Mehrserver Lösungen
Mehrserver LösungenMehrserver Lösungen
Mehrserver Lösungen
 
bccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-admins
bccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-adminsbccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-admins
bccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-admins
 
Tipps und Skripts aus dem Leben eines Connections Admins
Tipps und Skripts aus dem Leben eines Connections AdminsTipps und Skripts aus dem Leben eines Connections Admins
Tipps und Skripts aus dem Leben eines Connections Admins
 
Cloud Computing am Beispiel dctp.tv
Cloud Computing am Beispiel dctp.tvCloud Computing am Beispiel dctp.tv
Cloud Computing am Beispiel dctp.tv
 
Back to Basics - Webinar 6: Produktivsetzung einer Anwendung
Back to Basics - Webinar 6: Produktivsetzung einer AnwendungBack to Basics - Webinar 6: Produktivsetzung einer Anwendung
Back to Basics - Webinar 6: Produktivsetzung einer Anwendung
 
Where are all transactions gone? Was in_der_cloud_alles_verboten_ist
Where are all transactions gone? Was in_der_cloud_alles_verboten_istWhere are all transactions gone? Was in_der_cloud_alles_verboten_ist
Where are all transactions gone? Was in_der_cloud_alles_verboten_ist
 
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
Hybrid cloud iaa-s_office-365-azure_sharepoint-konferenz-wien-2013_ankbs_mich...
 
Java oberflächlich betrachtet - Welche GUI ist die richtige?
Java oberflächlich betrachtet - Welche GUI ist die richtige?Java oberflächlich betrachtet - Welche GUI ist die richtige?
Java oberflächlich betrachtet - Welche GUI ist die richtige?
 
Ruby on Rails SS09 02
Ruby on Rails SS09 02Ruby on Rails SS09 02
Ruby on Rails SS09 02
 
Cloud Deployment und (Auto)Scaling am Beispiel von Angrybird
Cloud Deployment und (Auto)Scaling am Beispiel von AngrybirdCloud Deployment und (Auto)Scaling am Beispiel von Angrybird
Cloud Deployment und (Auto)Scaling am Beispiel von Angrybird
 
The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...
The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...
The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...
 
ShareConf 2014: 10 Gründe warum der SharePoint langsam ist
ShareConf 2014: 10 Gründe warum der SharePoint langsam istShareConf 2014: 10 Gründe warum der SharePoint langsam ist
ShareConf 2014: 10 Gründe warum der SharePoint langsam ist
 
Ruby on Rails in a metro session
Ruby on Rails in a metro sessionRuby on Rails in a metro session
Ruby on Rails in a metro session
 
Webinar SharePoint auf AWS
Webinar SharePoint auf AWSWebinar SharePoint auf AWS
Webinar SharePoint auf AWS
 
200 verteilte Oracle- Server mit Ansible ausrollen
200 verteilte Oracle- Server mit Ansible ausrollen200 verteilte Oracle- Server mit Ansible ausrollen
200 verteilte Oracle- Server mit Ansible ausrollen
 
Blueprints bei E-Commerce Workloads mit AWS
Blueprints bei E-Commerce Workloads mit AWSBlueprints bei E-Commerce Workloads mit AWS
Blueprints bei E-Commerce Workloads mit AWS
 
Docker Workshop Experten Forum Stuttgart 2015, Agile Methoden GmbH
Docker Workshop Experten Forum Stuttgart 2015, Agile Methoden GmbHDocker Workshop Experten Forum Stuttgart 2015, Agile Methoden GmbH
Docker Workshop Experten Forum Stuttgart 2015, Agile Methoden GmbH
 

More from Jonathan Weiss

DevOpsDays Amsterdam - Observations in the cloud
DevOpsDays Amsterdam - Observations in the cloudDevOpsDays Amsterdam - Observations in the cloud
DevOpsDays Amsterdam - Observations in the cloud
Jonathan Weiss
 
CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010
Jonathan Weiss
 

More from Jonathan Weiss (20)

Docker on AWS OpsWorks
Docker on AWS OpsWorksDocker on AWS OpsWorks
Docker on AWS OpsWorks
 
ChefConf 2014 - AWS OpsWorks Under The Hood
ChefConf 2014 - AWS OpsWorks Under The HoodChefConf 2014 - AWS OpsWorks Under The Hood
ChefConf 2014 - AWS OpsWorks Under The Hood
 
AWS OpsWorks & Chef at the Hamburg Chef User Group 2014
AWS OpsWorks & Chef at the Hamburg Chef User Group 2014AWS OpsWorks & Chef at the Hamburg Chef User Group 2014
AWS OpsWorks & Chef at the Hamburg Chef User Group 2014
 
DevOpsDays Amsterdam - Observations in the cloud
DevOpsDays Amsterdam - Observations in the cloudDevOpsDays Amsterdam - Observations in the cloud
DevOpsDays Amsterdam - Observations in the cloud
 
Amazon SWF and Gordon
Amazon SWF and GordonAmazon SWF and Gordon
Amazon SWF and Gordon
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
Scalarium and CouchDB
Scalarium and CouchDBScalarium and CouchDB
Scalarium and CouchDB
 
Build your own clouds with Chef and MCollective
Build your own clouds with Chef and MCollectiveBuild your own clouds with Chef and MCollective
Build your own clouds with Chef and MCollective
 
NoSQL - Motivation and Overview
NoSQL - Motivation and OverviewNoSQL - Motivation and Overview
NoSQL - Motivation and Overview
 
NoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDBNoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDB
 
Running on Amazon EC2
Running on Amazon EC2Running on Amazon EC2
Running on Amazon EC2
 
Amazon EC2 in der Praxis
Amazon EC2 in der PraxisAmazon EC2 in der Praxis
Amazon EC2 in der Praxis
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Rails in the Cloud
Rails in the CloudRails in the Cloud
Rails in the Cloud
 
EventMachine
EventMachineEventMachine
EventMachine
 
CouchDB on Rails
CouchDB on RailsCouchDB on Rails
CouchDB on Rails
 
Rails in the Cloud - Experiences from running on EC2
Rails in the Cloud - Experiences from running on EC2Rails in the Cloud - Experiences from running on EC2
Rails in the Cloud - Experiences from running on EC2
 
CouchDB on Rails - RailsWayCon 2010
CouchDB on Rails - RailsWayCon 2010CouchDB on Rails - RailsWayCon 2010
CouchDB on Rails - RailsWayCon 2010
 
CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010
 
NoSQL - Post-Relational Databases - BarCamp Ruhr3
NoSQL - Post-Relational Databases - BarCamp Ruhr3NoSQL - Post-Relational Databases - BarCamp Ruhr3
NoSQL - Post-Relational Databases - BarCamp Ruhr3
 

Skalieren von Rails Anwendungen mit Amazon S3 und EC2