Rails hosting

Preview:

DESCRIPTION

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

Citation preview

Rails HostingOpenminds BVBA - Gent

www.openminds.be

Shared Rails HostingOpenminds::Hosting::Pro.clone

Architecture

• Controlable medium-sized

• Virtualized (Xen 3.x.y)

• Debian Etch

• Nginx ( proxy’s)

• Webservers

• MySQL 5/5.1 - PostgreSQL on DB

Architectuur

• Intel Dual Quad Core systemen / 16GB

• Centrale storage through iSCSI

• Tuning helps a lot

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

Version 1: pro’s

• fast

• lighttpd easily scriptable (lighty)

• lighttpd managed/monitors ruby processes

• mixing rails and php is possible

V1: Mephisto search

V1: Radiant page

Version 1: lighty

• Perl-wrapper around lighttpd

• port locking

• force the production-env

• easy, short configuration files for clients

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}

Version 1: con’s

• restart everything on change

• deploy => restart needed

• heavy sites => connection drops

• errors in logfiles

• errors in config files (new users)

Version 1: con’s

• port hijacking

• reboot: server dies

• process management is hard

Shared - Version 2Passenger (mod_rails)

Passenger

• Convinced

• Central daemon - Central config

• Process-heaven

• acts_like :php_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

General problems

• Gems

• Deployment

• No TESTING!

Non-sharedOpenminds::Hosting::Dedicated.clone

Dedicatedapplication & helper applications

client decides

Small DedicatedNginx + fair queueing + Mongrel cluster

Monit (m/monit)

Medium DedicatedPassenger (?)

Large DedicatedA la tête du client

Dedicatedsudo

TechnologyMongrel / Evented Mongrel / Ebb / Thin / Nginx /

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

Common

Rails version1 ) install new rails gem

2 ) Open support system

Gem-versionsSync

rake gems:freeze

DeploymentCapistrano

Provide recipy

PoundNo-worry-ssl

Rails is slowDeveloper

Hosting

Rails hostingInhouse Rails knowledge is needed

Warning

• database.yml

• restart application

• read your logs

Q&A

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

Recommended