35
Rails Hosting Openminds BVBA - Gent www.openminds.be

Rails hosting

  • Upload
    wonko

  • View
    974

  • Download
    2

Embed Size (px)

DESCRIPTION

The presentation I gave at Fosdem 2009 on sunday Feb 8 in the Ruby/Rails Devroom.

Citation preview

Page 1: Rails hosting

Rails HostingOpenminds BVBA - Gent

www.openminds.be

Page 2: Rails hosting

Shared Rails HostingOpenminds::Hosting::Pro.clone

Page 3: Rails hosting

Architecture

• Controlable medium-sized

• Virtualized (Xen 3.x.y)

• Debian Etch

• Nginx ( proxy’s)

• Webservers

• MySQL 5/5.1 - PostgreSQL on DB

Page 4: Rails hosting

Architectuur

• Intel Dual Quad Core systemen / 16GB

• Centrale storage through iSCSI

• Tuning helps a lot

Page 5: Rails hosting

Shared - version 1lighttpd & FastCGI (dispatch.fcgi)

Page 6: Rails hosting

Version 1: pro’s

• fast

• lighttpd easily scriptable (lighty)

• lighttpd managed/monitors ruby processes

• mixing rails and php is possible

Page 7: Rails hosting

V1: Mephisto search

Page 8: Rails hosting

V1: Radiant page

Page 9: Rails hosting

Version 1: lighty

• Perl-wrapper around lighttpd

• port locking

• force the production-env

• easy, short configuration files for clients

Page 10: Rails hosting

Version 1: lighty

$HTTP["host"] =~ "̂ (www.)?example.openminds.be" { var.app = "example" accesslog.filename = base + "/logs/" + app + ".access.log" server.errorlog = base + "/logs/" + app + ".error.log"

load Rails with capistrano app}

Page 11: Rails hosting

Version 1: con’s

• restart everything on change

• deploy => restart needed

• heavy sites => connection drops

• errors in logfiles

• errors in config files (new users)

Page 12: Rails hosting

Version 1: con’s

• port hijacking

• reboot: server dies

• process management is hard

Page 13: Rails hosting
Page 14: Rails hosting

Shared - Version 2Passenger (mod_rails)

Page 15: Rails hosting

Passenger

• Convinced

• Central daemon - Central config

• Process-heaven

• acts_like :php_hosting

Page 16: Rails hosting
Page 17: Rails hosting

Passenger: con’s

• No client-config files (sock)

• Maximum amount of processes limiting, not for minimum amount (startup delay)

• Apache 2: love & hate - small setup might give memory problems

Page 18: Rails hosting

General problems

• Gems

• Deployment

• No TESTING!

Page 19: Rails hosting

Non-sharedOpenminds::Hosting::Dedicated.clone

Page 20: Rails hosting

Dedicatedapplication & helper applications

client decides

Page 21: Rails hosting

Small DedicatedNginx + fair queueing + Mongrel cluster

Monit (m/monit)

Page 22: Rails hosting

Medium DedicatedPassenger (?)

Page 23: Rails hosting

Large DedicatedA la tête du client

Page 24: Rails hosting

Dedicatedsudo

Page 25: Rails hosting

TechnologyMongrel / Evented Mongrel / Ebb / Thin / Nginx /

Apache / Passenger / Merb / Enterprise Ruby / JRuby / Glassfish / ...

Page 26: Rails hosting

Common

Page 27: Rails hosting

Rails version1 ) install new rails gem

2 ) Open support system

Page 28: Rails hosting

Gem-versionsSync

rake gems:freeze

Page 29: Rails hosting

DeploymentCapistrano

Provide recipy

Page 30: Rails hosting

PoundNo-worry-ssl

Page 31: Rails hosting

Rails is slowDeveloper

Hosting

Page 32: Rails hosting

Rails hostingInhouse Rails knowledge is needed

Page 33: Rails hosting

Warning

• database.yml

• restart application

• read your logs

Page 34: Rails hosting

Q&A

Page 35: Rails hosting

WhoBernard Grymonpon / wonko([_\.]be)?Openminds BVBA - www.openminds.be