Wikiblog
Show Articles
lighty mongrel and capistrano
Senthil
Hi Senthil
I have seen that you are a prolific poster on ror
i have a few queries
is mongrel better than lighttpd
or do we need to run them together
do you have experience running mongrel
what is capistrano
why do we need it
thanks
****
Hi ****,
thank you, for calling me a prolific poster :)
lighttpd vs mongrel
you cant compare apples with oranges
apache and lighttpd are web servers they just serve files
rails is a ruby app which need to be run with some runner
the common runners are
- CGI(dead slow, never attempt on production)
- FCGI(a faster CGI implementation which loads the app in memory and caches it)
- SCGI(A new and supposedly better FCGI style app )
- Mongrel(It is a new type of app which uses direct HTTP protocol to run the ruby on rails app)
mongrel is done by Zed Shaw the same guy who did SCGI.
mongrel is still under major development, but has its advantages, you can get IIS to serve ruby on rails with a simple reverse proxy.
this reverse proxy logic can work with any webserver and platform, and using http can boost the scalability of applications.
once it starts beating other competitors with performance and speed, it will dominate in the hosting arena.
we have tested various combinations, apache with fcgi, apache with scgi, apache with mongrel, lighttpd with fcgi.
so now you would have understood that you need to run both lighttpd and mongrel together, but on clustered load balanced environment, you can run mongrel on seperate servers if your budget permits
Capistrano
capistrano, is a deployment tool which can save you hundreds of hours, if you have a continuosly evolving application which is liverails is not simple php app which once files are updated changes its behaviour.
ruby on rails application deployment steps. ( especially customer facing applications)
- setup you server,
- checkout the latest release from your version control system
- make DB migrations if any
- take backups
- clear stale sessions
- restart your rails runner
- if something goes bad undo the actions
the complexity will grow one you have to do deployment across multiple servers, seperate db, application, rails runners
if you want to automate it capistrano is the solution, it can work even for non rails application(php,perl,python etc).
capistrano uses ssh for securely connecting to different servers and execute some batch scripts.
currently servers can be only linux/*nix based, also has few assumption on same username passwords across all servers
my personal site is on version 86, my office site on version 450+, we are now confident with capistrano, we can deploy our apps in under 2 minutes on production, so even if a small fix or feature addition is made, we take it live quickly.
capistrano with rails brings Agile application development benifits for the masses
once capistrano is configured properly(you need to do it once i the beginning, later maybe when you move to newer servers or go cluster), the only command you need to execute on my console is
rake deploy
tell me about your app, and how you plan to deploy it,will help whatever I can
regards
A.Senthil Nayagam
http://senthilnayagam.com/
rails, tags: rails deployment,lighty,lighttpd, mongrel, capistrano, switch tower
created:06/17/2006 07:28AM
