SlideShare a Scribd company logo
1 of 193
Download to read offline
Deploying and Monitoring
Ruby on Rails
A practical guide




Mathias Meyer and Jonathan Weiss, 25.05.2009
Peritor GmbH
Who are we?

                           Jonathan Weiss

                           •  Consultant for Peritor GmbH in Berlin
                           •  Specialized in Rails, Scaling, Deployment, and Code Review
                           •  Webistrano - Rails deployment tool
                           •  FreeBSD Rubygems and Ruby on Rails maintainer




http://www.peritor.com
http://blog.innerewut.de



                                                                                           2
Who are we?

                      Mathias Meyer

                      •  Consultant for Peritor GmbH in Berlin
                      •  Specialized in Rails, Performance/Database Tuning,
                         Deployment, and Refactoring
                      •  Maintainer of Macistrano –
                         Webistrano-Client for Mac OS X (and soon the iPhone),
                         run_later and acts_as_solr




http://www.paperplanes.de




                                                                                 3
Agenda




 Infrastructure   Deployment   Practical Session   Monitoring   Q&A




                                                                      4
Infrastructure
  Infrastructure




                   5
Simple Rails Setup




       One Rails instance handles all requests
       Rails is single-threaded: There is only one concurrent request



                                                                        6
Rails Setup




              7
Rails Setup




              8
Typical Rails Setup

 •  A load-balancer distributes the incoming requests
 •  Some load-balancers will deliver static requests themselves
 •  Several Rails instances handle all requests
 •  Number of concurrent requests equals number of Rails instances




                                                                     9
Rails Setup Options




                      10
Deployment Questions
                                           Apache?          Pound?
             mod_proxy_balancer?

                                                        FastCGI?
       Mongrel?

              Proxy?                                   Load-balancer?

   Nginx?
                                                      mod_rails?
                  Ebb?
HA-Proxy?                                                       Reverse Proxy?
             Swiftiply?
                                                            Phusion Passenger?

   Thin?
                                                     Pen?
             Rails Application
              Server?              Lighttpd?
                                                                                 11
What we are going to cover today

Rails Application Server             Proxy/Web Server
 •  FastCGI                           •  Apache2
 •  Mongrel                           •  Nginx
 •  mod_rails / Phussion Passenger    •  Lighttpd
 •  JRuby + Glassfish & Co.            •  HA-Proxy




                                                        12
FastCGI




          13
FastCGI

 •  Protocol to communicate with long-running CGI applications
 •  Usage of either mod_fcgi with Apache 1.3 or mod_fcgi with Lighttpd
 •  Proxy local and remote FastCGI instances
 •  Oldest way of deploying Rails
 •  Deprecated and unstable
 •  Hard to debug (FastCGI protocol)




                                                                         14
FastCGI




          15
FastCGI




          16
17
Mongrel




          18
Mongrel

•  Developed by Zed Shaw as an alternative to FastCGI
•  Complete HTTP-Server that can load arbitrary Ruby-servlets
•  Built-in Rails support




                                                                19
Mongrel




          20
Mongrel




          Apache 2.2 – mod_proxy_balancer
          Lighttpd
          Nginx
          HA-Proxy
          Pound




                                            21
Mongrel Cluster



 Utility to manage several Mongrel instances




                                               22
Mongrel Cluster



 Control Mongrels




                    23
Mongrel and Apache 2.2




                         Define Mongrel Cluster
                         in Apache




                                                 24
Simple Mongrel and Apache 2.2



 Redirect all traffic to the Mongel cluster




                                             25
A more complex example

•  Redirect dynamic requests
•  Serve static content
•  Support cached pages
•  Support maintenance page
•  Enable client-side caching of
   images, stylesheets, and JavaScript
•  Compress output if supported




                                         26
Mongrel

•  Very robust
•  Strict HTTP parser
•  Easy to debug (HTTP!)
•  Used to be defacto deployment setup with Apache 2.2 and mod_proxy_balancer
•  Can be a bit difficult to setup (mongrel_cluster, ports, Apache)
•  Not so easy on mass/virtual hosting




                                                                                27
mod_rails




            28
mod_rails a.k.a Phusion Passenger

 •  Module for Apache 2.2 (and Nginx)
 •  Allows Apache to control Rails instances
 •  Apache starts and stops application instances depending on the application load
 •  Able to run any Rack-compatible Ruby application (Merb, Sinatra & Co.)
 •  Only manages Rails on one host - no remote instances
 •  Combine with HTTP-Proxy / balancing solution




                                                                                      29
Install Phusion Passenger

 Install Apache module




 Load and activate in Apache




                               30
Install Phusion Passenger

 Install Passenger with nginx (installs custom nginx)




 Configure nginx




                                                        31
Customized Phusion Passenger


 Control Rails instance number




                                 32
Control Phusion Passenger



 Restart after deployment:




                             33
Phusion Passenger




      One machine

                    34
Phusion Passenger




      One machine   Multiple machines

                                        35
Phusion Passenger

 •  Ready for production
 •  Makes setup easier – on the single machine level
 •  Multiple servers still require load balancer
 •  Suitable for mass-hosting
 •  upcoming standard way of deploying Rails




                                                       36
JRuby




        37
•  Ruby Runtime on the Java Virtual Machine
•  Implemented in Java and Ruby
•  Compiles Ruby into Java-bytecode
•  Integrates with Java code and libraries
•  Java’s promises of native threads and JIT
•  Allows for Ruby/Rails applications to be packaged as WAR files
•  WAR files deployable on any J2EE-container:
   Glassfish, JBoss, Tomcat, Jetty, …




                                                                   38
JRuby on Rails




                 39
JRuby on Glassfish




      One machine

                    40
JRuby on Glassfish




      One machine   Multiple machines

                                        41
Setup JRuby on Glassfish

 1.  Download JRuby and Glassfish
 2.  From http://blog.headius.com/2008/08/zero-to-production-in-15-minutes.html




                                                                                  42
Warble Configuration



                      Define min/max
                      Rails runtimes




                                       43
Glassfish for development


 Shrunk-down version of Glassfish v3 - packaged as a gem
 Can run any Rack-based application




 Installation:
     •  $ jruby -S gem install glassfish
     •  $ glassfish
     •  There is no Step 3




                                                          44
Rails Setup




              45
Proxy Options




                46
Proxy Requirements

 •  Hide cluster backend from the user
 •  Load-balancer backend instances
 •  Recognize down hosts
 •  Fair scheduler
 •  (Deliver static content)




                                         47
Apache 2.2

 •  Apache 2.2 introduced mod_proxy_balancer
 •  mod_proxy_balancer can speak to multiple backends and balance requests
 •  Apache can acts as a pure proxy or can also serve static files




                                                                             48
Apache 2.2

 •  Apache 2.2 introduced mod_proxy_balancer
 •  mod_proxy_balancer can speak to multiple backends and balance requests
 •  Apache can acts as a pure proxy or can also serve static files




                                                                             49
Apache 2.2

 •  Apache 2.2 introduced mod_proxy_balancer
 •  mod_proxy_balancer can speak to multiple backends and balance requests
 •  Apache can acts as a pure proxy or can also serve static files




                                                                             50
Apache 2.2

Pro
 •  Stable, robust, and mature
 •  Many people know how to work with Apache
 •  Integrates well with other modules (SVN, DAV, Auth, …)




Con
 •  Apache can be complicated to configure
 •  The stock Apache is quite resource-hungry compared to pure proxy solutions




                                                                                 51
Nginx – From Russia with love




 •  Nginx - popular Russian webserver with good proxy support
 •  Can load-balance multiple backends and deliver static content
 •  Quite popular with Mongrel as the Rails backend
 •  Recent Passenger support




                                                                    52
Nginx Configuration

Simple proxy example




Get complete version here:

http://brainspl.at/nginx.conf.txt




                                    53
Nginx

Pro
 •  Stable, robust, and fast
 •  Uses fewer resources (CPU and RAM) than Apache for proxy-mode and static files
 •  Simpler configuration file
 •  Can directly talk to memcached - SSI




Con
 •  More documentation would be nice
 •  No equivalent for many Apache modules




                                                                                    54
Lighttpd

 •  Lightweight and fast webserver
 •  Balancing proxy support
 •  Good FastCGI support
 •  Used to be popular – until Mongrel came around




                                                     55
Lighttpd Configuration

 Simple proxy example




                        56
Lighttpd

Pro
 •  Fast and lightweight
 •  Uses fewer resources (CPU and RAM) than Apache for proxy-mode and static files
 •  Simpler configuration file


Con
 •  Unstable for some people
 •  Slow development cycle
 •  More documentation would be nice
 •  Configuration file can be too simple (virtual host aliasing)
 •  No equivalent for many Apache modules
 •  (No Passenger support)

                                                                                    57
HA-Proxy


•  HAProxy – reliable, high performance TCP/HTTP load balancer
•  Proxying and content inspection
•  No content serving, just a proxy
•  Mature proxy module (fair scheduler)
•  ACL support




 See also similar Pound and Pen


                                                                 58
HAProxy


Simple proxy example




                       59
HAProxy

Pro
 •  Mature, stable, robust, and fast
 •  TCP and HTTP balancing




Con
 •  Few Rails examples
 •  Usually not needed in a Rails setup




                                          60
Recommended Setups




                     61
Small Site

             Recommendation
              Apache 2.2 with mod_rails /
              Phusion Passenger




                                            62
Medium Site

              Recommendation
               •  Apache/Nginx as the frontend proxy
               •  Passenger/mod_rails as the backend
               •  Deliver static files with Apache




                                                       63
Large Rails Setup


                    Recommendation
                     •  Redundant load-balancer
                     •  Redundant proxy / web
                     •  Passenger/mod_rails




                                              64
Heavy Static Files



Recommendation
 •  Deliver static assets
    through separate web
    server farm
 •  Passenger/mod_rails




                            65
Java Shop

            Recommendation
             •  Deliver a Rails-WAR file and you are
                done
             •  Integrate with existing Java
                landscape and infrastructure




                                                      66
67
Application Server Handler




                             68
Application Server Handler




                             69
Application Server Handler




                             70
Rack




       71
Rack Handler




               72
Rack




       73
Rack Middleware




                  74
Rack Middleware

•  Authentication (HTTP, OpenID)
•  Sessions
•  Routing
•  Caching
•  Logging
•  Debugging




                                   75
Support

Frameworks    Web Server
 •  Rails      •  CGI
 •  Merb       •  FastCGI
 •  Camping    •  Mongrel
 •  Sinatra    •  Phusion Passenger
 •  Mack       •  JRuby Servlets
 •  Maveric    •  WEBrick
 •  Halcyon    •  Ebb
 •  Ramaze     •  Thin
 •  Rum        •  LiteSpeed
 •  Vintage    •  Swiftcore
 •  Waves      •  Unicorn

                                      76
Remarks




          77
Ruby Enterprise Edition

 •  Copy-On-Write patches to Ruby 1.8
 •  Saves memory when spawning several Rails instances
 •  Used by Phusion Passenger if available




                                                         78
Thin, Ebb, Evented Mongrel & Co.

 •  Alternatives to Mongrel
 •  Claim to be faster, lighter, and what have you
 •  Rendering “Hello World” is usually not your bottleneck




                     Stick with stable and robust Mongrel, or better yet, with Passenger




                                                                                       79
Infrastructure
  Deployment




                 80
81
Deployment Options




                     82
Deployment Options




                     83
Deployment Options




                     84
Deployment Options




                     85
What does Capistrano do?




                           86
Capistrano Deployment Cycle




                              87
Requirements




               88
What doesn’t Capistrano do?

 •  Plan your initial server setup
 •  Configure basic services




                                     89
Basic Ingredients

 •  The cap command
 •  Variables
 •  Roles
 •  Tasks
 •  Namespaces




                      90
Basic Ingredients - cap

 Your one-stop deployment shop




                                 91
Basic Ingredients - Variables

 •  Configure basic project information
 •  Override Capistrano’s default assumptions
 •  Once set, variables are available globally
 •  Defined using the set method




                                                 92
Basic Ingredients - Roles

 •  Define types of servers
 •  Default roles
     •  :www
     •  :app
     •  :db
 •  All can point to the same server
 •  But all three must be defined




 •  At least one database server needs to be primary


                                                       93
Basic Ingredients - Roles

 Define custom roles as you please




 Can be reused when defining tasks




                                    94
Basic Ingredients - Tasks

 •  Define an atomic set of actions for Capistrano
 •  Can be called from the command line
 •  Or other tasks




                                                    95
Basic Ingredients - Tasks
 To find all the tasks available in your project, use




                                                       96
Basic Ingredients - Namespaces


 Group tasks together logically




 Namespaces and tasks are separated with “:”




                                               97
Get Your Capistrano On




                         98
Get Your Capistrano On

 Capfile, the place to include more recipes




                                             99
Get Your Capistrano On

 config/deploy.rb, application specific configuration




                                                     100
Capistrano’s Defaults

  •  Your SCM is Subversion
  •  Deployment directory is /u/apps/#{application_name}
  •  User for SCM and SSH is the currently logged-in user
  •  Commands are run with sudo




                                                            101
Get Your Capistrano On




                         102
Get Your Capistrano On

 •  Capistrano expects a directory structure
 •  Can be created with cap deploy:setup




                                               103
The Deployment Lifecycle




                           104
The Deployment Lifecycle

 Check the prerequisites:




                            105
The Deployment Lifecycle

 Set up your application for the first time




                                             106
The Deployment Lifecycle

 The initial deployment




     1.  Checks the revision from the local machine
     2.  Checks out the code on the remote machines
     3.  Sets a link called current pointing to the lates release
     4.  Runs the migrations
     5.  Fires up application servers




                                                                    107
The Deployment Lifecycle




                           108
The Deployment Lifecycle

 Subsequent deployments




    1.  Checks the revision from the local machine
    2.  Checks out the code on the remote machines
    3.  Updates current link
    4.  Restarts application servers




                                                     109
The Deployment Lifecycle




                           110
Common Capistrano Tasks

 Deploy and run migrations




 Run only the migrations




 Restart application servers




 Rollback to the previous release




                                    111
Have Your Shell, and Eat It Too




                                  112
Invoking any Command




                       113
Deployment Strategies




                        114
Deployment Strategies

 Direct checkout (from scratch) on the servers




                                                 115
Deployment Strategies

 Keep a cached copy of the current SCM head




                                              116
Deployment Strategies

 Check out locally and transfer




                                  117
Give it a little Spin

  Capistrano expects a script called spin in script/process




  For Passenger




                                                              118
Customizing Capistrano




                         119
Write your own Tasks




                       120
Write your own Tasks




                       121
Namespace your Tasks




                       122
Callbacks

 Execute a task before another runs




 Execute a task after another has finished




 Callbacks are run in the order they’re defined




                                                 123
Useful Variables




                   124
Transactions




               125
Transactions




               126
Transactions




               127
Transactions




               128
The Rest

 •  Gem dependencies
 •  Support for deploying through gateway servers
 •  Parallel execution on multiple servers
 •  Server setup with deprec gem




                                                    129
Vlad the Deployer




                    130
Vlad the Deployer

 •  Simple, Rake-based deployment solution
 •  Comes with defaults for most popular SCM, app and web servers




                                                                    131
Vlad the Deployer

 Load




 Configure




                    132
Vlad the Deployer




 Deployment




                    133
Vlad the Deployer

 •  Simple, sometimes too simple
 •  No callback mechanism, instead the Rake syntax must be used




 •  Very non-verbose output, using --trace recommended




                                                                  134
Chef

•  System Integration Framework
•  Written in Ruby – inspired by Puppet
•  Manage multiple nodes
   •  Configuration
   •  Packages
   •  Custom scripts and commands




                                          135
Architecture




               136
Recipes

Install and upgrade packages




                               137
Recipes

Create and update remote files




                                138
Recipes

Create and update remote files




                                139
chef-deploy

Enable




Use in recipe




                140
Chef and chef-deploy

 •  In heavy development: sometimes unstable and hard to debug
 •  Be prepared to get your hands dirty
 •  Better suited for configuration than deployment
 •  Community recipes at
    http://github.com/opscode/cookbooks




                                                                 141
One Click Deploy




                   142
Webistrano




             143
Webistrano

•  Web-UI to Capistrano
•  Manages projects and their stages
•  Alerting and Accounting
•  Scriptable and extendable
•  BSD License




                                       http://labs.peritor.com/webistrano




                                                                            144
Macistrano

 •  Mac-GUI to Webistrano
 •  Fire and monitor deployments from your desktop




                                          http://github.com/mattmatt/macistrano




                                                                                  145
Infrastructure
Practical Session




                    146
Practical Capistrano




                       147
EC2 Instances

 •  Users
     •  root / railswaycon
     •  deploy / railswaycon
 •  MySQL
     •  root / ‘’
 •  Apache Configuration
     •  /etc/apache2/sites-enabled/default
 •  Rails
     •  /srv/www




                                             148
Git Repository

 •  git://github.com/mattmatt/railscasts.git
 •  Setup the servers
 •  Deploy!




                                               149
Tasks

 •  Make memcached restart with every deploy
 •  (Usually not a good idea, but why not?)




                                               150
Tasks

 •  Make Apache recognize maintenance.html and display it if exists




                                                                      151
Maintenance Page

•  Create symbolic link to /etc/apache2/mods-available/rewrite.load in /etc/apache2/
   mods-enabled
•  Update virtual host configuration with rewrite rules




•  Run cap deploy:web:disable
•  Hook it into the deployment process




                                                                                       152
Tasks

 •  Deploy a Rack-based application
 •  Install Sinatra locally and on the server
 •  git://github.com/mattmatt/railswaycon.git
 •  Create deployment configuration
 •  Create Apache configuration




                                                153
Infrastructure
   Monitoring




                 154
The two questions of monitoring




                                  155
1. Is everything still running?




                                  156
2. What are the trends?




                          157
Monit

•  Process-level monitoring
•  Checks PID-files, ports, and permissions
•  Reacts by executing a script and/or alerting
•  Has a web GUI for administering nodes




                                                  158
Monit

MySQL




        159
Monit

Apache




         160
Monit

Mongrel




          161
God

•  Ruby-based configuration
•  Easily extendible
•  Can work with event- and poll-based conditions
•  Comes with less recipes than Monit




                                                    162
God

Mongrel




          163
Munin

•  Host-level monitoring
•  Master periodically asks nodes for local data
•  Checks system resources and records historical data
•  Allows to recognize trends and make predictions
•  Alerting support




                                                         164
Munin




        165
Munin




        166
Munin




        167
Exception Monitoring

 •  Monitor errors raised by your application
 •  Usually notifying you by email
 •  Good old exception_notification Plugin
 •  Exceptions as a Service




                                                168
Hoptoad




          169
Exceptional




              170
New Relic

 •  Rails Performance monitoring
 •  Live view into your application




                                      171
Other Tools

 •  Nagios
 •  Big Brother
 •  New Relic RPM
 •  FiveRuns
 •  JMX




                    172
Infrastructure
Advanced Deployment




                      173
Search




         174
Search

Full text search




Can become very slow on big data sets




                                        175
Full Text Search Engine

Separate Service
 •  Creates full text index
 •  Application queries search daemon
 •  Index update through application or
    database


Possible Engines
 •  Ferret
 •  Sphinx
 •  Solr
 •  Lucene
 •  …

                                          176
Search Slave

Database replication slave
 •  Has complete dataset
 •  Migrates slow search queries from master
 •  Can use different database table engine




                                               177
Database Index

PostgreSQL Tsearch2
 •  Core since 8.3
 •  Allows to create full text index on multiple columns
    or arbitrary SQL expressions


MySQL MyISAM FULLTEXT index
 •  Only works with MySQL <= 5.0 and MyISAM tables
 •  Full text index on multiple columns




                                                           178
What to use?

Different characteristics
 •  Real-time updates and stale data
 •  Lost updates
 •  Performance
 •  Document content and format
 •  Complexity




                                       179
Background Processing




                        180
Problem

Long running tasks
 •  Resizing uploaded images
 •  Mailing
 •  Computing an expensive operation
 •  Accessing slow back-ends




When running inside request-response-cycle
 •  Blocks user
 •  Blocks Rails instance
 •  Hard to monitor and debug



                                             181
Solution

Asynchronous processing in the background




      Message/Queue                         Scheduler



                                                        182
Background Processing




                        183
Options



 Options for message bus:   Options for background process:
 •  Database                •  (Ruby) Daemon
 •  Amazon SQS              •  Cron job with script/runner
 •  Drb                     •  Forked process
 •  Memcache                •  Delayed Job / BJ / (Backgroundrb)
 •  ActiveMQ                •  run_later
 •  …                       •  ….




                                                                   184
Database/Ruby daemon example




                               185
Cloud Infrastructure




                       186
Cloud Infrastructure

Servers come and go
 •  You do not know your servers before deploying
 •  Restarting is the same as introducing a new machine




You can’t hardcode IPs
 database.yml




                                                          187
Solution #1

Query and manually adjust
 •  Servers do not change that often
 •  New nodes probably need manual intervention
 •  Use AWS ElasticIPs to ease the pain




Set servers dynamically                      AWS Elastic IP




                                                              188
Solution #2

Use a central directory service
 •  A central place to manage your running instances
 •  Instances query the directory and react




                                                       189
Solution #2

Use a central directory service
 •  A central place to manage your running instances
 •  Instances query the directory and react




                                                       190
Central Directory

Different Implementations
 •  File on S3
 •  SimpleDB
 •  A complete service,
    capable of monitoring and controlling your instances




                                                           191
Q&A




      192
Peritor GmbH

Teutonenstraße 16
14129 Berlin
Telefon: +49 (0)30 69 20 09 84 0
Telefax: +49 (0)30 69 20 09 84 9

Internet: www.peritor.com
E-Mail: kontakt@peritor.com




                                          193
Peritor GmbH - Alle Rechte vorbehalten         193

More Related Content

What's hot

Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011leo lapworth
 
Puppet Camp London Fall 2015 - Service Discovery and Puppet
Puppet Camp London Fall 2015 - Service Discovery and PuppetPuppet Camp London Fall 2015 - Service Discovery and Puppet
Puppet Camp London Fall 2015 - Service Discovery and PuppetMarc Cluet
 
20141210 rakuten techtalk
20141210 rakuten techtalk20141210 rakuten techtalk
20141210 rakuten techtalkHiroshi SHIBATA
 
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...Mark West
 
ApacheCon EU 2014: Enterprise Development with Apache Karaf
ApacheCon EU 2014: Enterprise Development with Apache KarafApacheCon EU 2014: Enterprise Development with Apache Karaf
ApacheCon EU 2014: Enterprise Development with Apache KarafAchim Nierbeck
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSource Conference
 
How to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyHow to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyJakub Wadolowski
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesikmfrancis
 
The details of CI/CD environment for Ruby
The details of CI/CD environment for RubyThe details of CI/CD environment for Ruby
The details of CI/CD environment for RubyHiroshi SHIBATA
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mrubyHiroshi SHIBATA
 
Immutable infrastructure:觀念與實作 (建議)
Immutable infrastructure:觀念與實作 (建議)Immutable infrastructure:觀念與實作 (建議)
Immutable infrastructure:觀念與實作 (建議)William Yeh
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSamantha Quiñones
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Arun Gupta
 
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南Shengyou Fan
 

What's hot (19)

Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011
 
Puppet Camp London Fall 2015 - Service Discovery and Puppet
Puppet Camp London Fall 2015 - Service Discovery and PuppetPuppet Camp London Fall 2015 - Service Discovery and Puppet
Puppet Camp London Fall 2015 - Service Discovery and Puppet
 
20141210 rakuten techtalk
20141210 rakuten techtalk20141210 rakuten techtalk
20141210 rakuten techtalk
 
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
 
ApacheCon EU 2014: Enterprise Development with Apache Karaf
ApacheCon EU 2014: Enterprise Development with Apache KarafApacheCon EU 2014: Enterprise Development with Apache Karaf
ApacheCon EU 2014: Enterprise Development with Apache Karaf
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on Rails
 
(Re)discover your AEM
(Re)discover your AEM(Re)discover your AEM
(Re)discover your AEM
 
How to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyHow to stay sane during your Vagrant journey
How to stay sane during your Vagrant journey
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
 
The details of CI/CD environment for Ruby
The details of CI/CD environment for RubyThe details of CI/CD environment for Ruby
The details of CI/CD environment for Ruby
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
20140925 rails pacific
20140925 rails pacific20140925 rails pacific
20140925 rails pacific
 
Immutable infrastructure:觀念與實作 (建議)
Immutable infrastructure:觀念與實作 (建議)Immutable infrastructure:觀念與實作 (建議)
Immutable infrastructure:觀念與實作 (建議)
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with Varnish
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
 
From a cluster to the Cloud
From a cluster to the CloudFrom a cluster to the Cloud
From a cluster to the Cloud
 
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
 
Tomcat openssl
Tomcat opensslTomcat openssl
Tomcat openssl
 

Similar to Deploying And Monitoring Rails

Deployment with Ruby on Rails
Deployment with Ruby on RailsDeployment with Ruby on Rails
Deployment with Ruby on RailsJonathan Weiss
 
Rails Conf Europe 2007 - Utilizing Amazon S3 and EC2 in Rails
Rails Conf Europe 2007 - Utilizing Amazon S3 and EC2 in RailsRails Conf Europe 2007 - Utilizing Amazon S3 and EC2 in Rails
Rails Conf Europe 2007 - Utilizing Amazon S3 and EC2 in RailsJonathan Weiss
 
Xen_and_Rails_deployment
Xen_and_Rails_deploymentXen_and_Rails_deployment
Xen_and_Rails_deploymentAbhishek Singh
 
Rails hosting
Rails hostingRails hosting
Rails hostingwonko
 
From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Clusterguestd34230
 
Dynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFishDynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFishIndicThreads
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)Flowdock
 
Everyday tools and tricks for scaling Node.js
Everyday tools and tricks for scaling Node.jsEveryday tools and tricks for scaling Node.js
Everyday tools and tricks for scaling Node.jsNikolay Stoitsev
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09Michael Neale
 
The future of the php development environment
The future of the php development environmentThe future of the php development environment
The future of the php development environmentJeremy Quinton
 
Web And App Servers
Web And App ServersWeb And App Servers
Web And App ServersAkshay Gupta
 
Virtualization & Network Connectivity
Virtualization & Network Connectivity Virtualization & Network Connectivity
Virtualization & Network Connectivity itplant
 
AP4R on RubyKaigi2007 (English only)
AP4R on RubyKaigi2007 (English only)AP4R on RubyKaigi2007 (English only)
AP4R on RubyKaigi2007 (English only)Kato Kiwamu
 
Scripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full VersionScripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full VersionEduardo Pelegri-Llopart
 
Acus08 Advanced Load Balancing Apache2.2
Acus08 Advanced Load Balancing Apache2.2Acus08 Advanced Load Balancing Apache2.2
Acus08 Advanced Load Balancing Apache2.2Jim Jagielski
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the CloudArun Gupta
 

Similar to Deploying And Monitoring Rails (20)

Deployment with Ruby on Rails
Deployment with Ruby on RailsDeployment with Ruby on Rails
Deployment with Ruby on Rails
 
re7jweiss
re7jweissre7jweiss
re7jweiss
 
OpenSolaris Web Stack MySQL BOF
OpenSolaris Web Stack MySQL BOFOpenSolaris Web Stack MySQL BOF
OpenSolaris Web Stack MySQL BOF
 
Rails Conf Europe 2007 - Utilizing Amazon S3 and EC2 in Rails
Rails Conf Europe 2007 - Utilizing Amazon S3 and EC2 in RailsRails Conf Europe 2007 - Utilizing Amazon S3 and EC2 in Rails
Rails Conf Europe 2007 - Utilizing Amazon S3 and EC2 in Rails
 
Xen_and_Rails_deployment
Xen_and_Rails_deploymentXen_and_Rails_deployment
Xen_and_Rails_deployment
 
Rails hosting
Rails hostingRails hosting
Rails hosting
 
From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Cluster
 
Dynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFishDynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFish
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
 
Everyday tools and tricks for scaling Node.js
Everyday tools and tricks for scaling Node.jsEveryday tools and tricks for scaling Node.js
Everyday tools and tricks for scaling Node.js
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09
 
The future of the php development environment
The future of the php development environmentThe future of the php development environment
The future of the php development environment
 
Web And App Servers
Web And App ServersWeb And App Servers
Web And App Servers
 
Ruby Deployment
Ruby DeploymentRuby Deployment
Ruby Deployment
 
Virtualization & Network Connectivity
Virtualization & Network Connectivity Virtualization & Network Connectivity
Virtualization & Network Connectivity
 
AP4R on RubyKaigi2007 (English only)
AP4R on RubyKaigi2007 (English only)AP4R on RubyKaigi2007 (English only)
AP4R on RubyKaigi2007 (English only)
 
Scripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full VersionScripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full Version
 
GlassFish v3 Prelude Aquarium Paris
GlassFish v3 Prelude Aquarium ParisGlassFish v3 Prelude Aquarium Paris
GlassFish v3 Prelude Aquarium Paris
 
Acus08 Advanced Load Balancing Apache2.2
Acus08 Advanced Load Balancing Apache2.2Acus08 Advanced Load Balancing Apache2.2
Acus08 Advanced Load Balancing Apache2.2
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the Cloud
 

More from Jonathan Weiss

Docker on AWS OpsWorks
Docker on AWS OpsWorksDocker on AWS OpsWorks
Docker on AWS OpsWorksJonathan Weiss
 
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 HoodJonathan Weiss
 
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 2014Jonathan Weiss
 
DevOpsDays Amsterdam - Observations in the cloud
DevOpsDays Amsterdam - Observations in the cloudDevOpsDays Amsterdam - Observations in the cloud
DevOpsDays Amsterdam - Observations in the cloudJonathan Weiss
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.jsJonathan Weiss
 
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 MCollectiveJonathan Weiss
 
NoSQL - Motivation and Overview
NoSQL - Motivation and OverviewNoSQL - Motivation and Overview
NoSQL - Motivation and OverviewJonathan Weiss
 
NoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDBNoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDBJonathan Weiss
 
Amazon EC2 in der Praxis
Amazon EC2 in der PraxisAmazon EC2 in der Praxis
Amazon EC2 in der PraxisJonathan Weiss
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with ChefJonathan Weiss
 
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 EC2Jonathan Weiss
 
CouchDB on Rails - RailsWayCon 2010
CouchDB on Rails - RailsWayCon 2010CouchDB on Rails - RailsWayCon 2010
CouchDB on Rails - RailsWayCon 2010Jonathan Weiss
 
CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010Jonathan Weiss
 
NoSQL - Post-Relational Databases - BarCamp Ruhr3
NoSQL - Post-Relational Databases - BarCamp Ruhr3NoSQL - Post-Relational Databases - BarCamp Ruhr3
NoSQL - Post-Relational Databases - BarCamp Ruhr3Jonathan 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
 

Recently uploaded

Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Recently uploaded (20)

Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

Deploying And Monitoring Rails

  • 1. Deploying and Monitoring Ruby on Rails A practical guide Mathias Meyer and Jonathan Weiss, 25.05.2009 Peritor GmbH
  • 2. Who are we? Jonathan Weiss •  Consultant for Peritor GmbH in Berlin •  Specialized in Rails, Scaling, Deployment, and Code Review •  Webistrano - Rails deployment tool •  FreeBSD Rubygems and Ruby on Rails maintainer http://www.peritor.com http://blog.innerewut.de 2
  • 3. Who are we? Mathias Meyer •  Consultant for Peritor GmbH in Berlin •  Specialized in Rails, Performance/Database Tuning, Deployment, and Refactoring •  Maintainer of Macistrano – Webistrano-Client for Mac OS X (and soon the iPhone), run_later and acts_as_solr http://www.paperplanes.de 3
  • 4. Agenda Infrastructure Deployment Practical Session Monitoring Q&A 4
  • 6. Simple Rails Setup One Rails instance handles all requests Rails is single-threaded: There is only one concurrent request 6
  • 9. Typical Rails Setup •  A load-balancer distributes the incoming requests •  Some load-balancers will deliver static requests themselves •  Several Rails instances handle all requests •  Number of concurrent requests equals number of Rails instances 9
  • 11. Deployment Questions Apache? Pound? mod_proxy_balancer? FastCGI? Mongrel? Proxy? Load-balancer? Nginx? mod_rails? Ebb? HA-Proxy? Reverse Proxy? Swiftiply? Phusion Passenger? Thin? Pen? Rails Application Server? Lighttpd? 11
  • 12. What we are going to cover today Rails Application Server Proxy/Web Server •  FastCGI •  Apache2 •  Mongrel •  Nginx •  mod_rails / Phussion Passenger •  Lighttpd •  JRuby + Glassfish & Co. •  HA-Proxy 12
  • 13. FastCGI 13
  • 14. FastCGI •  Protocol to communicate with long-running CGI applications •  Usage of either mod_fcgi with Apache 1.3 or mod_fcgi with Lighttpd •  Proxy local and remote FastCGI instances •  Oldest way of deploying Rails •  Deprecated and unstable •  Hard to debug (FastCGI protocol) 14
  • 15. FastCGI 15
  • 16. FastCGI 16
  • 17. 17
  • 18. Mongrel 18
  • 19. Mongrel •  Developed by Zed Shaw as an alternative to FastCGI •  Complete HTTP-Server that can load arbitrary Ruby-servlets •  Built-in Rails support 19
  • 20. Mongrel 20
  • 21. Mongrel Apache 2.2 – mod_proxy_balancer Lighttpd Nginx HA-Proxy Pound 21
  • 22. Mongrel Cluster Utility to manage several Mongrel instances 22
  • 23. Mongrel Cluster Control Mongrels 23
  • 24. Mongrel and Apache 2.2 Define Mongrel Cluster in Apache 24
  • 25. Simple Mongrel and Apache 2.2 Redirect all traffic to the Mongel cluster 25
  • 26. A more complex example •  Redirect dynamic requests •  Serve static content •  Support cached pages •  Support maintenance page •  Enable client-side caching of images, stylesheets, and JavaScript •  Compress output if supported 26
  • 27. Mongrel •  Very robust •  Strict HTTP parser •  Easy to debug (HTTP!) •  Used to be defacto deployment setup with Apache 2.2 and mod_proxy_balancer •  Can be a bit difficult to setup (mongrel_cluster, ports, Apache) •  Not so easy on mass/virtual hosting 27
  • 28. mod_rails 28
  • 29. mod_rails a.k.a Phusion Passenger •  Module for Apache 2.2 (and Nginx) •  Allows Apache to control Rails instances •  Apache starts and stops application instances depending on the application load •  Able to run any Rack-compatible Ruby application (Merb, Sinatra & Co.) •  Only manages Rails on one host - no remote instances •  Combine with HTTP-Proxy / balancing solution 29
  • 30. Install Phusion Passenger Install Apache module Load and activate in Apache 30
  • 31. Install Phusion Passenger Install Passenger with nginx (installs custom nginx) Configure nginx 31
  • 32. Customized Phusion Passenger Control Rails instance number 32
  • 33. Control Phusion Passenger Restart after deployment: 33
  • 34. Phusion Passenger One machine 34
  • 35. Phusion Passenger One machine Multiple machines 35
  • 36. Phusion Passenger •  Ready for production •  Makes setup easier – on the single machine level •  Multiple servers still require load balancer •  Suitable for mass-hosting •  upcoming standard way of deploying Rails 36
  • 37. JRuby 37
  • 38. •  Ruby Runtime on the Java Virtual Machine •  Implemented in Java and Ruby •  Compiles Ruby into Java-bytecode •  Integrates with Java code and libraries •  Java’s promises of native threads and JIT •  Allows for Ruby/Rails applications to be packaged as WAR files •  WAR files deployable on any J2EE-container: Glassfish, JBoss, Tomcat, Jetty, … 38
  • 40. JRuby on Glassfish One machine 40
  • 41. JRuby on Glassfish One machine Multiple machines 41
  • 42. Setup JRuby on Glassfish 1.  Download JRuby and Glassfish 2.  From http://blog.headius.com/2008/08/zero-to-production-in-15-minutes.html 42
  • 43. Warble Configuration Define min/max Rails runtimes 43
  • 44. Glassfish for development Shrunk-down version of Glassfish v3 - packaged as a gem Can run any Rack-based application Installation: •  $ jruby -S gem install glassfish •  $ glassfish •  There is no Step 3 44
  • 47. Proxy Requirements •  Hide cluster backend from the user •  Load-balancer backend instances •  Recognize down hosts •  Fair scheduler •  (Deliver static content) 47
  • 48. Apache 2.2 •  Apache 2.2 introduced mod_proxy_balancer •  mod_proxy_balancer can speak to multiple backends and balance requests •  Apache can acts as a pure proxy or can also serve static files 48
  • 49. Apache 2.2 •  Apache 2.2 introduced mod_proxy_balancer •  mod_proxy_balancer can speak to multiple backends and balance requests •  Apache can acts as a pure proxy or can also serve static files 49
  • 50. Apache 2.2 •  Apache 2.2 introduced mod_proxy_balancer •  mod_proxy_balancer can speak to multiple backends and balance requests •  Apache can acts as a pure proxy or can also serve static files 50
  • 51. Apache 2.2 Pro •  Stable, robust, and mature •  Many people know how to work with Apache •  Integrates well with other modules (SVN, DAV, Auth, …) Con •  Apache can be complicated to configure •  The stock Apache is quite resource-hungry compared to pure proxy solutions 51
  • 52. Nginx – From Russia with love •  Nginx - popular Russian webserver with good proxy support •  Can load-balance multiple backends and deliver static content •  Quite popular with Mongrel as the Rails backend •  Recent Passenger support 52
  • 53. Nginx Configuration Simple proxy example Get complete version here: http://brainspl.at/nginx.conf.txt 53
  • 54. Nginx Pro •  Stable, robust, and fast •  Uses fewer resources (CPU and RAM) than Apache for proxy-mode and static files •  Simpler configuration file •  Can directly talk to memcached - SSI Con •  More documentation would be nice •  No equivalent for many Apache modules 54
  • 55. Lighttpd •  Lightweight and fast webserver •  Balancing proxy support •  Good FastCGI support •  Used to be popular – until Mongrel came around 55
  • 56. Lighttpd Configuration Simple proxy example 56
  • 57. Lighttpd Pro •  Fast and lightweight •  Uses fewer resources (CPU and RAM) than Apache for proxy-mode and static files •  Simpler configuration file Con •  Unstable for some people •  Slow development cycle •  More documentation would be nice •  Configuration file can be too simple (virtual host aliasing) •  No equivalent for many Apache modules •  (No Passenger support) 57
  • 58. HA-Proxy •  HAProxy – reliable, high performance TCP/HTTP load balancer •  Proxying and content inspection •  No content serving, just a proxy •  Mature proxy module (fair scheduler) •  ACL support See also similar Pound and Pen 58
  • 60. HAProxy Pro •  Mature, stable, robust, and fast •  TCP and HTTP balancing Con •  Few Rails examples •  Usually not needed in a Rails setup 60
  • 62. Small Site Recommendation Apache 2.2 with mod_rails / Phusion Passenger 62
  • 63. Medium Site Recommendation •  Apache/Nginx as the frontend proxy •  Passenger/mod_rails as the backend •  Deliver static files with Apache 63
  • 64. Large Rails Setup Recommendation •  Redundant load-balancer •  Redundant proxy / web •  Passenger/mod_rails 64
  • 65. Heavy Static Files Recommendation •  Deliver static assets through separate web server farm •  Passenger/mod_rails 65
  • 66. Java Shop Recommendation •  Deliver a Rails-WAR file and you are done •  Integrate with existing Java landscape and infrastructure 66
  • 67. 67
  • 71. Rack 71
  • 73. Rack 73
  • 75. Rack Middleware •  Authentication (HTTP, OpenID) •  Sessions •  Routing •  Caching •  Logging •  Debugging 75
  • 76. Support Frameworks Web Server •  Rails •  CGI •  Merb •  FastCGI •  Camping •  Mongrel •  Sinatra •  Phusion Passenger •  Mack •  JRuby Servlets •  Maveric •  WEBrick •  Halcyon •  Ebb •  Ramaze •  Thin •  Rum •  LiteSpeed •  Vintage •  Swiftcore •  Waves •  Unicorn 76
  • 77. Remarks 77
  • 78. Ruby Enterprise Edition •  Copy-On-Write patches to Ruby 1.8 •  Saves memory when spawning several Rails instances •  Used by Phusion Passenger if available 78
  • 79. Thin, Ebb, Evented Mongrel & Co. •  Alternatives to Mongrel •  Claim to be faster, lighter, and what have you •  Rendering “Hello World” is usually not your bottleneck Stick with stable and robust Mongrel, or better yet, with Passenger 79
  • 81. 81
  • 89. What doesn’t Capistrano do? •  Plan your initial server setup •  Configure basic services 89
  • 90. Basic Ingredients •  The cap command •  Variables •  Roles •  Tasks •  Namespaces 90
  • 91. Basic Ingredients - cap Your one-stop deployment shop 91
  • 92. Basic Ingredients - Variables •  Configure basic project information •  Override Capistrano’s default assumptions •  Once set, variables are available globally •  Defined using the set method 92
  • 93. Basic Ingredients - Roles •  Define types of servers •  Default roles •  :www •  :app •  :db •  All can point to the same server •  But all three must be defined •  At least one database server needs to be primary 93
  • 94. Basic Ingredients - Roles Define custom roles as you please Can be reused when defining tasks 94
  • 95. Basic Ingredients - Tasks •  Define an atomic set of actions for Capistrano •  Can be called from the command line •  Or other tasks 95
  • 96. Basic Ingredients - Tasks To find all the tasks available in your project, use 96
  • 97. Basic Ingredients - Namespaces Group tasks together logically Namespaces and tasks are separated with “:” 97
  • 99. Get Your Capistrano On Capfile, the place to include more recipes 99
  • 100. Get Your Capistrano On config/deploy.rb, application specific configuration 100
  • 101. Capistrano’s Defaults •  Your SCM is Subversion •  Deployment directory is /u/apps/#{application_name} •  User for SCM and SSH is the currently logged-in user •  Commands are run with sudo 101
  • 103. Get Your Capistrano On •  Capistrano expects a directory structure •  Can be created with cap deploy:setup 103
  • 105. The Deployment Lifecycle Check the prerequisites: 105
  • 106. The Deployment Lifecycle Set up your application for the first time 106
  • 107. The Deployment Lifecycle The initial deployment 1.  Checks the revision from the local machine 2.  Checks out the code on the remote machines 3.  Sets a link called current pointing to the lates release 4.  Runs the migrations 5.  Fires up application servers 107
  • 109. The Deployment Lifecycle Subsequent deployments 1.  Checks the revision from the local machine 2.  Checks out the code on the remote machines 3.  Updates current link 4.  Restarts application servers 109
  • 111. Common Capistrano Tasks Deploy and run migrations Run only the migrations Restart application servers Rollback to the previous release 111
  • 112. Have Your Shell, and Eat It Too 112
  • 115. Deployment Strategies Direct checkout (from scratch) on the servers 115
  • 116. Deployment Strategies Keep a cached copy of the current SCM head 116
  • 117. Deployment Strategies Check out locally and transfer 117
  • 118. Give it a little Spin Capistrano expects a script called spin in script/process For Passenger 118
  • 120. Write your own Tasks 120
  • 121. Write your own Tasks 121
  • 123. Callbacks Execute a task before another runs Execute a task after another has finished Callbacks are run in the order they’re defined 123
  • 125. Transactions 125
  • 126. Transactions 126
  • 127. Transactions 127
  • 128. Transactions 128
  • 129. The Rest •  Gem dependencies •  Support for deploying through gateway servers •  Parallel execution on multiple servers •  Server setup with deprec gem 129
  • 131. Vlad the Deployer •  Simple, Rake-based deployment solution •  Comes with defaults for most popular SCM, app and web servers 131
  • 132. Vlad the Deployer Load Configure 132
  • 133. Vlad the Deployer Deployment 133
  • 134. Vlad the Deployer •  Simple, sometimes too simple •  No callback mechanism, instead the Rake syntax must be used •  Very non-verbose output, using --trace recommended 134
  • 135. Chef •  System Integration Framework •  Written in Ruby – inspired by Puppet •  Manage multiple nodes •  Configuration •  Packages •  Custom scripts and commands 135
  • 136. Architecture 136
  • 138. Recipes Create and update remote files 138
  • 139. Recipes Create and update remote files 139
  • 141. Chef and chef-deploy •  In heavy development: sometimes unstable and hard to debug •  Be prepared to get your hands dirty •  Better suited for configuration than deployment •  Community recipes at http://github.com/opscode/cookbooks 141
  • 143. Webistrano 143
  • 144. Webistrano •  Web-UI to Capistrano •  Manages projects and their stages •  Alerting and Accounting •  Scriptable and extendable •  BSD License http://labs.peritor.com/webistrano 144
  • 145. Macistrano •  Mac-GUI to Webistrano •  Fire and monitor deployments from your desktop http://github.com/mattmatt/macistrano 145
  • 148. EC2 Instances •  Users •  root / railswaycon •  deploy / railswaycon •  MySQL •  root / ‘’ •  Apache Configuration •  /etc/apache2/sites-enabled/default •  Rails •  /srv/www 148
  • 149. Git Repository •  git://github.com/mattmatt/railscasts.git •  Setup the servers •  Deploy! 149
  • 150. Tasks •  Make memcached restart with every deploy •  (Usually not a good idea, but why not?) 150
  • 151. Tasks •  Make Apache recognize maintenance.html and display it if exists 151
  • 152. Maintenance Page •  Create symbolic link to /etc/apache2/mods-available/rewrite.load in /etc/apache2/ mods-enabled •  Update virtual host configuration with rewrite rules •  Run cap deploy:web:disable •  Hook it into the deployment process 152
  • 153. Tasks •  Deploy a Rack-based application •  Install Sinatra locally and on the server •  git://github.com/mattmatt/railswaycon.git •  Create deployment configuration •  Create Apache configuration 153
  • 154. Infrastructure Monitoring 154
  • 155. The two questions of monitoring 155
  • 156. 1. Is everything still running? 156
  • 157. 2. What are the trends? 157
  • 158. Monit •  Process-level monitoring •  Checks PID-files, ports, and permissions •  Reacts by executing a script and/or alerting •  Has a web GUI for administering nodes 158
  • 159. Monit MySQL 159
  • 160. Monit Apache 160
  • 162. God •  Ruby-based configuration •  Easily extendible •  Can work with event- and poll-based conditions •  Comes with less recipes than Monit 162
  • 163. God Mongrel 163
  • 164. Munin •  Host-level monitoring •  Master periodically asks nodes for local data •  Checks system resources and records historical data •  Allows to recognize trends and make predictions •  Alerting support 164
  • 165. Munin 165
  • 166. Munin 166
  • 167. Munin 167
  • 168. Exception Monitoring •  Monitor errors raised by your application •  Usually notifying you by email •  Good old exception_notification Plugin •  Exceptions as a Service 168
  • 169. Hoptoad 169
  • 170. Exceptional 170
  • 171. New Relic •  Rails Performance monitoring •  Live view into your application 171
  • 172. Other Tools •  Nagios •  Big Brother •  New Relic RPM •  FiveRuns •  JMX 172
  • 174. Search 174
  • 175. Search Full text search Can become very slow on big data sets 175
  • 176. Full Text Search Engine Separate Service •  Creates full text index •  Application queries search daemon •  Index update through application or database Possible Engines •  Ferret •  Sphinx •  Solr •  Lucene •  … 176
  • 177. Search Slave Database replication slave •  Has complete dataset •  Migrates slow search queries from master •  Can use different database table engine 177
  • 178. Database Index PostgreSQL Tsearch2 •  Core since 8.3 •  Allows to create full text index on multiple columns or arbitrary SQL expressions MySQL MyISAM FULLTEXT index •  Only works with MySQL <= 5.0 and MyISAM tables •  Full text index on multiple columns 178
  • 179. What to use? Different characteristics •  Real-time updates and stale data •  Lost updates •  Performance •  Document content and format •  Complexity 179
  • 181. Problem Long running tasks •  Resizing uploaded images •  Mailing •  Computing an expensive operation •  Accessing slow back-ends When running inside request-response-cycle •  Blocks user •  Blocks Rails instance •  Hard to monitor and debug 181
  • 182. Solution Asynchronous processing in the background Message/Queue Scheduler 182
  • 184. Options Options for message bus: Options for background process: •  Database •  (Ruby) Daemon •  Amazon SQS •  Cron job with script/runner •  Drb •  Forked process •  Memcache •  Delayed Job / BJ / (Backgroundrb) •  ActiveMQ •  run_later •  … •  …. 184
  • 187. Cloud Infrastructure Servers come and go •  You do not know your servers before deploying •  Restarting is the same as introducing a new machine You can’t hardcode IPs database.yml 187
  • 188. Solution #1 Query and manually adjust •  Servers do not change that often •  New nodes probably need manual intervention •  Use AWS ElasticIPs to ease the pain Set servers dynamically AWS Elastic IP 188
  • 189. Solution #2 Use a central directory service •  A central place to manage your running instances •  Instances query the directory and react 189
  • 190. Solution #2 Use a central directory service •  A central place to manage your running instances •  Instances query the directory and react 190
  • 191. Central Directory Different Implementations •  File on S3 •  SimpleDB •  A complete service, capable of monitoring and controlling your instances 191
  • 192. Q&A 192
  • 193. Peritor GmbH Teutonenstraße 16 14129 Berlin Telefon: +49 (0)30 69 20 09 84 0 Telefax: +49 (0)30 69 20 09 84 9 Internet: www.peritor.com E-Mail: kontakt@peritor.com 193 Peritor GmbH - Alle Rechte vorbehalten 193