Real World
Rails Deployment




    Alan Hecht
Deployment Options

• Heroku - PaaS

• Shared Web Hosting

• Virtual Private Server

• Amazon Web Services - IaaS
Heroku - PaaS

• No setup & no system administration
  -   Easy to deploy

• Free when using one web process
  -   Pay as you scale

• App will idle after inactivity if only using one
  process (“dyno”)

• Additional “dyno” + database > 5MB is
  $50/month
Shared Web Hosting

• Cheap - $5 to $10 per month


• Web hosting control panel (i.e. cPanel) to
  configure web server & web application


• Limited to what is on the server


• Not recommended
  -   Constrained by CPU usage
Virtual Private Server
• Starts at around $25 per month


• Extremely flexible, can load anything you want


• System administration knowledge required
  -   Must maintain server


• Good for one or two standalone servers
Amazon Web Services - IaaS
• Building a virtual data center
  • Netflix runs on AWS


• Can load instances with a pre-built O/S


• Pay as you scale


• Most expensive option
Running Rails

• WEBrick should only be used in a
  development environment

• Need a web server to handle static
  requests
  - Images, HTML, JavaScript, CSS

• Need a Ruby web application server to
  handle Rails requests (i.e. Unicorn,
  Thin, or Passenger)
Web Server

• Apache & Nginx the two most popular
  choices


• Rack is used as an interface between
  the web server and Rails
Apache

• Most popular web server and has the
  many options & features


• Process-based web server


• Good for handling dynamic content via
  modules
Nginx

• Light weight web server that only
  handles static content


• Event-based web server


• Low memory usage
Apache or Nginx

• Pick one - either works

• Nginx better on a VPS because of low
  memory usage

• Apache is full-featured

• Nginx does a few things well
Rails Web App Servers

• Phusion Passenger, Thin, and Unicorn
  currently the most widely used Rails app
  servers


• Can be installed as a web server plugin
  or as a separate Ruby Gem
Phusion Passenger

• Acts as an Apache or Nginx module


• Philosophy – same as Rails (DRY,
  convention over configuration)


• Easy to deploy & maintain
  - No separate configuration file
Thin

• Event based Rails server


• Philosophy – tiny, fast, and secure


• Used by Heroku
Unicorn

• Process-based Rails server


• Philosophy – Unicorn is Unix


• Used by Twitter & GitHub
Nginx + Unicorn Architecture
Sample Nginx Configuration
Which One?

• People have built scalable sites with all
  three


• Thin & Unicorn need configuration,
  Passenger does not


• Performance depends on the
  application
  - “Hello World” apps not useful for profiling
Capistrano

•Tool for deploying Rails (or Rack)
applications



•Similar in structure to Rakefile
Sample Capistrano Script
What Does a Scalable Site
 Architecture Look Like?
          Content Delivery Network




                Nginx SSL

                HA Proxy



Nginx        Nginx              Nginx
  +            +                  +
Unicorn      Unicorn            Unicorn

More Related Content

PPT
Ruby Setup
PPT
Intro to SPA using JavaScript & ASP.NET
KEY
Scala and Lift
PDF
React.js for Rails Developers
PDF
Building & Testing Scalable Rails Applications
PDF
Beyond Apache: Faster Web Servers
PDF
React on rails v6.1 at LA Ruby, November 2016
PDF
A Practical Introduction to Functions-as-a-Service
Ruby Setup
Intro to SPA using JavaScript & ASP.NET
Scala and Lift
React.js for Rails Developers
Building & Testing Scalable Rails Applications
Beyond Apache: Faster Web Servers
React on rails v6.1 at LA Ruby, November 2016
A Practical Introduction to Functions-as-a-Service

What's hot (20)

PDF
Webcomponents are your frameworks best friend
PPTX
ReactPHP + Symfony
PDF
Frameworks and webcomponents
PPT
DevOpsCon Cloud Workshop
PDF
Fluxible
PPTX
Microservices: Yes or not?
PDF
Adobe AEM for Business Heads
PDF
Velocity - NxtGen Oxford
PPTX
10 tips to make your ASP.NET Apps Faster
PPTX
Building rest services using aspnetwebapi
PPTX
Building solutions with the SharePoint Framework - deep-dive
PPTX
Owin & katana
PDF
Velocity - Edge UG
PPTX
Getting Started with ASP.NET 5
PPTX
Building real time app by using asp.Net Core
PPT
Vagrant&ansible
PPTX
Host, deploy & scale Blazor Server Apps
PPTX
Developing Cross-Platform Web Apps with ASP.NET Core1.0
PDF
Introduction 2 to aws and storage options
PDF
WebAssembly vs JavaScript: What is faster?
Webcomponents are your frameworks best friend
ReactPHP + Symfony
Frameworks and webcomponents
DevOpsCon Cloud Workshop
Fluxible
Microservices: Yes or not?
Adobe AEM for Business Heads
Velocity - NxtGen Oxford
10 tips to make your ASP.NET Apps Faster
Building rest services using aspnetwebapi
Building solutions with the SharePoint Framework - deep-dive
Owin & katana
Velocity - Edge UG
Getting Started with ASP.NET 5
Building real time app by using asp.Net Core
Vagrant&ansible
Host, deploy & scale Blazor Server Apps
Developing Cross-Platform Web Apps with ASP.NET Core1.0
Introduction 2 to aws and storage options
WebAssembly vs JavaScript: What is faster?

Similar to Real World Rails Deployment (20)

PDF
Amazon Web Services Building Blocks for Drupal Applications and Hosting
PPTX
Wikipedia Cloud Search Webinar
PPTX
Moving to the Cloud: AWS, Zend, RightScale
PDF
Rami Sayar - Node microservices with Docker
PDF
Intro to Serverless
PPTX
What are clouds made from
PPTX
Comprehensive Guide to Node.js for Server-Side JavaScript Development
PPTX
NetflixOSS for Triangle Devops Oct 2013
PPT
Beyond Heroku: Hosting Your Rails App Yourself
PDF
Migrating to aws
PDF
Apereo OAE - Bootcamp
PDF
Bitnami Bootcamp. OpenStack
PPT
Performance stack
PPTX
Web Servers(IIS, NGINX, APACHE)
PPTX
OpenStack and Windows
PDF
Webinar - DreamObjects/Ceph Case Study
PPTX
High performance web sites with multilevel caching
PPTX
AWS Distilled
PPTX
Urbanesia - Development History
PDF
A Tale of 2 Systems
Amazon Web Services Building Blocks for Drupal Applications and Hosting
Wikipedia Cloud Search Webinar
Moving to the Cloud: AWS, Zend, RightScale
Rami Sayar - Node microservices with Docker
Intro to Serverless
What are clouds made from
Comprehensive Guide to Node.js for Server-Side JavaScript Development
NetflixOSS for Triangle Devops Oct 2013
Beyond Heroku: Hosting Your Rails App Yourself
Migrating to aws
Apereo OAE - Bootcamp
Bitnami Bootcamp. OpenStack
Performance stack
Web Servers(IIS, NGINX, APACHE)
OpenStack and Windows
Webinar - DreamObjects/Ceph Case Study
High performance web sites with multilevel caching
AWS Distilled
Urbanesia - Development History
A Tale of 2 Systems

Recently uploaded (20)

PDF
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
PDF
Addressing the challenges of harmonizing law and artificial intelligence tech...
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
The AI Revolution in Customer Service - 2025
PPTX
Build automations faster and more reliably with UiPath ScreenPlay
PDF
NewMind AI Journal Monthly Chronicles - August 2025
PPTX
From Curiosity to ROI — Cost-Benefit Analysis of Agentic Automation [3/6]
PDF
Decision Optimization - From Theory to Practice
PDF
Streamline Vulnerability Management From Minimal Images to SBOMs
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PDF
substrate PowerPoint Presentation basic one
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PPTX
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
PPTX
Blending method and technology for hydrogen.pptx
PPTX
CRM(Customer Relationship Managmnet) Presentation
PDF
Altius execution marketplace concept.pdf
PDF
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
PDF
Secure Java Applications against Quantum Threats
PPTX
How to use fields_get method in Odoo 18
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
Addressing the challenges of harmonizing law and artificial intelligence tech...
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
The AI Revolution in Customer Service - 2025
Build automations faster and more reliably with UiPath ScreenPlay
NewMind AI Journal Monthly Chronicles - August 2025
From Curiosity to ROI — Cost-Benefit Analysis of Agentic Automation [3/6]
Decision Optimization - From Theory to Practice
Streamline Vulnerability Management From Minimal Images to SBOMs
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
substrate PowerPoint Presentation basic one
Intravenous drug administration application for pediatric patients via augmen...
EIS-Webinar-Regulated-Industries-2025-08.pdf
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
Blending method and technology for hydrogen.pptx
CRM(Customer Relationship Managmnet) Presentation
Altius execution marketplace concept.pdf
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
Secure Java Applications against Quantum Threats
How to use fields_get method in Odoo 18

Real World Rails Deployment

  • 2. Deployment Options • Heroku - PaaS • Shared Web Hosting • Virtual Private Server • Amazon Web Services - IaaS
  • 3. Heroku - PaaS • No setup & no system administration - Easy to deploy • Free when using one web process - Pay as you scale • App will idle after inactivity if only using one process (“dyno”) • Additional “dyno” + database > 5MB is $50/month
  • 4. Shared Web Hosting • Cheap - $5 to $10 per month • Web hosting control panel (i.e. cPanel) to configure web server & web application • Limited to what is on the server • Not recommended - Constrained by CPU usage
  • 5. Virtual Private Server • Starts at around $25 per month • Extremely flexible, can load anything you want • System administration knowledge required - Must maintain server • Good for one or two standalone servers
  • 6. Amazon Web Services - IaaS • Building a virtual data center • Netflix runs on AWS • Can load instances with a pre-built O/S • Pay as you scale • Most expensive option
  • 7. Running Rails • WEBrick should only be used in a development environment • Need a web server to handle static requests - Images, HTML, JavaScript, CSS • Need a Ruby web application server to handle Rails requests (i.e. Unicorn, Thin, or Passenger)
  • 8. Web Server • Apache & Nginx the two most popular choices • Rack is used as an interface between the web server and Rails
  • 9. Apache • Most popular web server and has the many options & features • Process-based web server • Good for handling dynamic content via modules
  • 10. Nginx • Light weight web server that only handles static content • Event-based web server • Low memory usage
  • 11. Apache or Nginx • Pick one - either works • Nginx better on a VPS because of low memory usage • Apache is full-featured • Nginx does a few things well
  • 12. Rails Web App Servers • Phusion Passenger, Thin, and Unicorn currently the most widely used Rails app servers • Can be installed as a web server plugin or as a separate Ruby Gem
  • 13. Phusion Passenger • Acts as an Apache or Nginx module • Philosophy – same as Rails (DRY, convention over configuration) • Easy to deploy & maintain - No separate configuration file
  • 14. Thin • Event based Rails server • Philosophy – tiny, fast, and secure • Used by Heroku
  • 15. Unicorn • Process-based Rails server • Philosophy – Unicorn is Unix • Used by Twitter & GitHub
  • 16. Nginx + Unicorn Architecture
  • 18. Which One? • People have built scalable sites with all three • Thin & Unicorn need configuration, Passenger does not • Performance depends on the application - “Hello World” apps not useful for profiling
  • 19. Capistrano •Tool for deploying Rails (or Rack) applications •Similar in structure to Rakefile
  • 21. What Does a Scalable Site Architecture Look Like? Content Delivery Network Nginx SSL HA Proxy Nginx Nginx Nginx + + + Unicorn Unicorn Unicorn