Thin: un velocissimo server web per Ruby on Rails

Ruby On Rails


Volevo informarvi che finalmente abbiamo a disposizione un "nuovo" server web, Thin la sua fatures più interessante (la notate nel grafico) è che rispetto a Mongrel è molto più veloce.

Thin è basato su 3 librerie:

  1. Mongrel parser che fornisce velocità e sicurezza
  2. Event Machine, una libreria network I/O che è molto scalabile, performante e stabile
  3. Rack, una interfaccia minimale tra webserver e Ruby frameworks

Bene, ora non vi resta che installarlo cosi:

sudo gem install thin

e inizializzarlo così

cd /directory/rails/app 
thin start

oppure se necessitate di configurazione per ambienti di produzione potete usare Rack rackup. Create un file config.ru e scrivete:

require 'thin'

app = proc do |env|
  [ 200, { 'Content-Type' => 'text/html' }, ['hi'] ]
end

run app

Per avviarlo invece basterà

rackup -s thin

Questo post è stato inviato il January 05, 2008 11:09 e Posted in , . Puoi seguire tutte le risposte tramite il Atom feed. You can leave a comments, Or a trackback from your own site.
Tags , , , ,


Trackbacks

Utilizza il link seguente per fare trackback dal tuo sito
http://blog.lipsiasoft.com/trackbacks?article_id=thin-un-velocissimo-server-web-per-ruby-on-rails&day=05&month=01&year=2008

Commenti

Lascia una risposta

Lascia un commento