Thin

Post on 15-Jan-2015

5.550 views 2 download

Tags:

description

Slides from a Lightning Talk for the Atlanta Ruby Users Group on Thin, a Ruby web server.

Transcript of Thin

thinhttp://code.macournoyer.com/thin/

what?

replacement for mongrel

Ruby web server

glues three Ruby libraries

mongrel parser

eventmachine

rack

why?

more active development

nicer to use

how?

$ sudo gem install rack

$ sudo gem install thin eventmachine \ --source http://code.macournoyer.com

development

$ cd /to/my/rails/app$ thin start>> Using rails adapter>> Thin web server (v0.8.0 codename Dodgy Dentist)>> Threaded mode OFF>> Maximum connections set to 1024>> Listening on 0.0.0.0:3000, CTRL+C to stop

$ cd /to/my/rails/app$ thin -d start

$ script/console$ script/generate stuff$ tail -f log/development.log

$ thin stop

production

# example config/thin.yml---pid: tmp/pids/thin.pidlog: log/thin.logmax_conns: 1024timeout: 30max_persistent_conns: 512daemonize: trueenvironment: productionchdir: /path/to/your/appservers: 2port: 8000

$ thin -C /path/to/thin.yml start

plays well with cap and god

Resources:salesforceonrails.com/tags/thin